\documentclass[man,12pt]{apa}
\usepackage{apa}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{url}
\usepackage[latin1]{inputenc} 
\usepackage{caption}
\usepackage{subcaption}
%\usepackage[nogin]{Sweave}

\author{Alexander L. Davis*}
\affiliation{Department of Social and Decision Sciences\\
Carnegie Mellon University}
\note{\begin{flushleft} 
*E-mail address: alexander.l.davis1@gmail.com, Department of Social and Decision Sciences, Carnegie Mellon University, Pittsburgh PA 15213, USA, 412-216-2040. \end{flushleft}}

\acknowledgements{All materials and data can be obtained from the first author's Dataverse at \url{http://hdl.handle.net/1902.1/18699}. Open lab notebook can be obtained at \url{http://openwetware.org/wiki/User:Alexander_L._Davis}.  We would like to thank NSF for the dissertation enhancement grant. Thank you to John Sperger and Terence Einhorn for help collecting the data}

\title{Incentives, Error, and Data Sharing}
\shorttitle{Incentives, Error, and Data Sharing}

\abstract{This research examines when individuals solving Wason's 2-4-6 rule discovery task attribute disconfirming feedback to error, and whether they decide to share perceived errors with another person trying to solve the same problem.  Participants invoked error for disconfirming feedback more than for affirming feedback.  Fixed-response data sharing decisions during the task (Experiment Two) and at the end of the task (Experiments Three and Four), found that participants were less likely to share trials when feedback was disconfirming or when trials were attributed to error, even after controlling for actual error.  Experiments Two through Four found that incentives had no effects on rule discovery or attributions to error.  However, the perverse incentive used in Experiments Three and Four gave participants a financial motive to suppress data, but they did the opposite, deciding to share unconvincing data that could cost them money.  Overall, decisions to share data were reasonable, depended too much on whether the data were perceived to be in error, and were not corrupted by incentives to hide disconfirming data.}

%These attributions to error were inaccurate when there was no financial penalty for inaccuracy (Experiments One and Two), but accurate when there was a financial penalty (Experiments Three and Four).  

\begin{document}

<<preamble,echo=false,results=hide,fig=false>>=
load("was1")
#install.packages("arm")
library(arm)
options(scipen=0,digits=2)
n1<-200
n2<-200
n3<-200
ptrunc<-function(x){ifelse(x<0.001,0.001,x)}
@

%\section{Submission Questions}
%\emph{1. What will the reader of this article learn about psychology that she or he did not (or could not) have known before?}

%The \emph{positive test strategy} is a hypothesis-testing strategy that seeks affirmation and discounts disconfirmation.  The article demonstrates that this strategy extends to communication of data, such that data are less likely to be shared with another participant who can use them if they are disconfirming or perceived to be in error.  Furthermore, incentives for discovery or for sharing data have no effect on this positive test strategy or data sharing, but penalties for incorrect judgments improve the accuracy and consistency of error attributions.  Finally, decisions not to share data are determined more by perception of error than by actual error, as perceptions are inappropriately influenced by whether feedback was disconfirming or affirming, even after controlling for actual error.

%\emph{2. Why is that knowledge important for the field?}

%So far there is very little research on what data people consider worthy of sharing with others and why.  This research shows that people perceive disconfirming data to be caused by error, and in turn, should not be shared with others.  These results establish some of the social-cognitive context of scientific reasoning.  Furthermore, the results suggest that scientists may need training to help them develop effective data sharing policies when they get disconfirming results, and that penalties for inaccurate judgments can increase their ability to identify error.  Even with these penalties, training is needed to help scientists understand the effect of feedback on their data sharing policies.

%\emph{3. How are the claims made in the article justified by the methods used?}

%The Wason 2-4-6 rule discovery task is the classic paradigm for studying the positive test strategy.  It provides a simulation of hypothesis testing that is simple and reflects the core features of hypothesis testing and data sharing, with affirming or disconfirming feedback, the use of logical reasoning and insight, and probabilistic reasoning when there is the possibility of error.  The data sharing task provides a simple method of measuring data sharing, and all measures were verified with open-ended comprehension checks.

%The main text counts, as do notes (or footnotes), acknowledgments, and appendices. The abstract, references, material in tables, and figure legends do not count. 
%At most 40 references and three figures/tables.

\newpage

\maketitle
Hypothesis testing has been found to follow a \emph{positive test strategy}.  Researchers collect data that they expect to conform to their prior beliefs and then exaggerate its information value \cite{klayman1987confirmation}, while discounting any inconsistent evidence that comes their way \cite{dunbar1995scientists,dunbar2001scientific,gorman2005scientific,lord1979biased}. This result has been found with both simple experimental tasks and in dynamic artificial environments, such as simulated molecular biology \cite{dunbar1993concept}, programmed robots \cite{klahr1988dual}, and multiple-cue probability learning \cite{o1989effects}.  Similar patterns have been found in scientific laboratories.  For example, in an observational study of a biological sciences laboratory, \citeA{dunbar2001scientific} found that scientists did not immediately reject their hypotheses after they were contradicted by data.  Rather, their first reaction was to invoke experimental error \cite{dunbar1995scientists,dunbar2001scientific,gorman2005scientific}.  In thirty-seven experimental treatments conducted by one biologist, twenty-one had unexpected results, most of which were treated as errors \cite{dunbar2001scientific}.

After inspecting their data for errors, researchers must decide whether to communicate any data that they consider flawed.  If the researchers' attributions to error are accurate, then omitting these errors from published reports may avoid distracting readers.  If they are inaccurate, then failing to publish those data will allow false theories to emerge and persist.  Justified or not, data attributed to error are unlikely to be shared.  For example, statistical significance is often (incorrectly) interpreted as the probability of error in data, and is usually a necessary condition for publication \cite<e.g.,>{fanelli2012negative,sterling1959publication}.

Data sharing decisions are not only affected by whether the data are perceived to be faulty, but also by professional rewards for publishing positive (usually statistically significant) results \cite{angell2000academic,bodenheimer2000uneasy,nathan1999academia,weatherall2000academia}.  These rewards can produce a healthy motivation to make a discovery, such as finding a successful anti-cancer drug.  However, rewards may also undermine accurate data inspection by increasing scrutiny of results that indicate the discovery is false, while simultaneously making affirming results a wanted relief from the pressure to produce \cite{kunda1990case}.  Supporting this account, there is evidence that higher rewards for publishing are associated with publication bias \cite{ioannidis2005early,fanelli2010pressures}.

Here we present four experiments on decisions to share possibly faulty data.  We use Wason's 2-4-6 rule-discovery task \cite{wason1960failure}.  It asks participants to discover the rule that generated a set of numbers (2, 4, 6), by proposing a new set of three numbers (a proposed triple), then getting feedback as to whether the numbers that they proposed fit the rule.  We use \citeA{penner1996trust}'s version, in which participants are told that some percentage of the time, the feedback will be false---a feature that adds something like the uncertainty that is inevitable with scientific inferences. 

We add several new features to the task.  (a) Before receiving feedback, participants assess the probability that it will affirm their expectations.  (b) After receiving it, they indicate whether they would share each trial, including the feedback, with a second person trying to discover the same rule. In Experiment One, the sharing decision is done at the end of the task.  In Experiment Two, the data sharing decision is done immediately after participants make their error judgments.  In Experiments Three and Four, it is done both after each trial and at the end of the task.  (c) We also use two types of incentives intended to simulate the rewards that may lead to motivated reasoning.  Experiment Two provides participants with a large incentive (\$100) for correctly guessing the rule, and a small incentive (\$1) for concluding that they do not know the answer.  Experiments Three and Four provide participants with an incentive to convince a matched participant that they discovered the rule, whether or not they actually did.

Using this task, we first replicate the finding that error is more likely to be invoked with disconfirming than with affirming feedback \cite{penner1996trust,gorman1986possibility,gorman1989error}.  We then examine whether these attributions to error are justified using two evaluative criteria: (a)  \emph{accuracy}, defined as whether the judgments are correct; and (b) \emph{Bayesian consistency}, defined as attributing feedback to error if and only if either: (i) participants strongly expected the triple they proposed to fit the rule but it did not, or (ii) participants strongly expected the triple they proposed to not fit the rule but it did.\footnote{More precisely, using Bayes' Rule it can be shown that feedback should be attributed to error whenever one believes that there is greater than an 80\% prior probability that the triple fit the rule, but the feedback indicates it does not fit, or conversely one believes there is less than a 20\% prior probability that the triple fit the rule, but the feedback indicates that it does fit.}  \emph{Selective reporting} is the degree to which trials attributed to error are not shared with the matched participant, compared to those attributed to other sources.  

\section{Experiment One}
Experiment One looks at whether attributions to error are consistent with prior beliefs, whether they correspond to actual error, and whether trials are less likely to be shared with another person when the feedback is attributed to error.  We used the Wason 2-4-6 rule discovery task with feedback error \cite{penner1996trust}.  

\subsection{Method}
\subsubsection{Participants}
Eighteen Carnegie Mellon University undergraduates completed the task for course credit.
%\footnote{A random-effects meta-analysis of the effect of disconfirming feedback on attributions to error from Penner and Klahr's Study One (numerical broad and narrow conditions), Penner and Klahr's Study Two (numerical/narrow) \cite{penner1996trust} and Gorman \cite{gorman1986possibility}, indicated an overall effect size of Hedges' $G=0.43$, 95\% CI [0.33, 0.53].  The sample sizes of the control groups in these studies were 15, 15, 25, and 24, respectively, indicating eighteen participants should provide sufficient power to detect the effect of feedback on error attribution.}  They were on average 21 years old (range: 18 -- 38).  There were 7 women.  One participant gave no valid responses. 

\subsubsection{Procedure}
Participants were seated at a computer, asked to sign an informed consent document, and then instructed that they had 30 minutes to complete the task.  Participants completed the task online as a Qualtrics questionnaire with embedded Javascript used for feedback.  Each page (trial) of the questionnaire had the same format.  In order, participants proposed a rule, proposed a new triple, assessed the probability that the triple they proposed fit the Actual Rule, received feedback, judged whether the feedback reflected error, and then decided if they wanted to give their Final Answer.  They were reminded to record all responses both on the computer and on the spreadsheet they were given.  After participants decided to stop new trials and give their Final Answer, or thirty minutes had passed, they were asked to review their spreadsheet and mark the trials that they thought should be shared, in order to help a new participant solve the problem.

\subsubsection{Materials}
The materials were a modification of \citeA{penner1996trust}'s version of the Wason 2-4-6 rule discovery task (see \url{http://hdl.handle.net/1902.1/18699} for full materials).

%, with the study introduction rewritten to increase readability and comprehension, based on pretesting using cognitive interviews.  The study also used computerized, rather than hand-written, feedback.

\subsubsection{Introduction}

Participants were shown the following introduction on the computer along with a separate paper copy as a reminder:

\begin{quote}
``You will be given three numbers that are related somehow. For example: 3, 5, and 15. This is called a triple. There are many possible rules that could relate these three numbers. We have selected only one of them. The rule that we selected is called the Actual Rule. You will not be given the Actual Rule. Your task is to discover it. The initial triple on the next page is an example drawn from the Actual Rule.''

``Our study is using several versions of this task.  Yours is a particularly difficult one.  Sometimes, even if your Proposed Triple FITs the Actual Rule, the computer may output that it DOES NOT FIT. Conversely, sometimes, when your Proposed Triple DOES NOT FIT the rule, the computer may output that it FITs. On any trial there is a 20\% chance that you will get false feedback. For each trial if you think false feedback occurred mark ``F'' in the ``Feedback'' column on your spreadsheet. If you think true feedback occurred, mark ``T'' in the ``Feedback'' column.''

``At any time you may try to guess the Actual Rule that we selected. This is called the Final Answer. You only get one Final Answer and it may be wrong. Once you make your Final Answer you can no longer get feedback from the computer and the experiment will end.''
\end{quote}

\subsubsection{Initial Triple}
At the top of each page, the initial triple (2,4,6) was shown.  Participants were told:
\begin{quote}
``The initial triple above is an example drawn from the Actual Rule.''
\end{quote}

\subsubsection{Proposed Triple}
After writing their best explanation of the initial triple, they were instructed to propose a new triple:
\begin{quote}
``You may propose additional triples to help you discover the Actual Rule. The computer will tell you whether the triple you proposed fits the Actual Rule. Record all information on the spreadsheet you were given.  Write one number of your triple in each box below.''
\end{quote}

\subsubsection{Prior Probability}

On each trial, before they received feedback, participants assigned a probability that the triple they proposed fit the actual rule, by answering the following question:

\begin{quote}
``What is the probability that the triple you proposed fits the Actual Rule? (must be a number between 0 and 100)'' 
\end{quote}

\begin{flushleft}
We denote this $P(TFTR)$ for `[P]robability that the [T]riple [F]its [T]he actual [R]ule'.
\end{flushleft}

\subsubsection{Attribution to Error}

Immediately after receiving feedback that the triple fit (FIT) or did not fit (DNF) the rule, participants judged whether they thought the feedback was due to error:

\begin{quote}
``Do you think this feedback was true or false? (True/False)''
\end{quote}

\subsubsection{Final Answer}
After participants felt they had completed enough trials, or the 30--minute window expired, they were asked to make their Final Answer:
\begin{quote}
``Write your Final Answer for the Actual Rule in the box below (it can be mathematical or in words).''
\end{quote}

\subsubsection{Data sharing}

Participants then decided which trials they wanted to share with a new participant:

\begin{quote}
``In this experiment, a trial is a page where you proposed a rule, a triple, a probability estimate, received feedback, and judged whether you thought the feedback was false or true.'' 

``In a future experiment we will have a new participant try to discover the same rule you tried to discover. 

You can choose trials that you think will help him or her solve the rule. 
For each trial you indicate, all of the information would be shared, including: 
\begin{enumerate}
\item your rule
\item the proposed triple
\item your probability estimate
\item the feedback
\item whether you thought the feedback was false or true
\end{enumerate}

In the space below, please indicate the trials you conducted that you think would help this person.'' 
\end{quote}

\subsection{Results}
<<exp1,results=hide,echo=false,fig=false>>=
##Hierarchical linear model for correlation between prior (P(TFTR)) and error attribution##
wasqa<-subset(was1,falsification==0)
wasqa$error.should<-ifelse(wasqa$p.fit<0.2,1,0)

phiaff<-glmer(error.should~error+(1|subjectid),data=wasqa,family=binomial(link="logit"))
phiaff.null<-glmer(error.should~(1|subjectid),data=wasqa,family=binomial(link="logit"))
affnova<-anova(phiaff.null,phiaff)
affchip<-affnova$Chisq[2]
affphip<-sqrt(affnova$Chisq[2]/length(wasqa$error.should))
affphi.p<-affnova[2,7]

wasqf<-subset(was1,falsification==1)
wasqf$error.should<-ifelse(wasqf$p.fit>0.8,1,0)

phidisc<-glmer(error.should~error+(1|subjectid),data=wasqf,family=binomial(link="logit"))
phidisc.null<-glmer(error.should~(1|subjectid),data=wasqf,family=binomial(link="logit"))
discnova<-anova(phidisc.null,phidisc)
discchip<-discnova$Chisq[2]
discphip<-sqrt(discnova$Chisq[2]/length(wasqf$error.should))
discphi.p<-discnova[2,7]

wasq<-rbind(wasqa,wasqf)
glmer.ov<-glmer(error.should~error+(1|subjectid),data=wasq,family=binomial(link="logit"))
glmer.ov.null<-glmer(error.should~(1|subjectid),data=wasq,family=binomial(link="logit"))
nova.ov<-anova(glmer.ov.null,glmer.ov)
chi.ov<-nova.ov$Chisq[2]
phi.ov<-sqrt(chi.ov/length(wasq$actual.error))
should.error<-glmer(error~error.should*falsification+(1|subjectid),data=wasq,family=binomial(link="logit"))

####
##Nested Boostrap##
chip<-c()
phip<-c()
phi.p<-c()
glmeraa<-c()
glmerff<-c()
glmershnerr<-c()
glmersherr<-c()
glmersha<-c()
glmershf<-c()
qf<-was1
qf$new.id<-c(rep(0,length(qf$subjectid)))
for(i in 1:n1){
a<-seq(18)
a<-a[!a==13]
a<-sort(sample(a,size=17,replace=TRUE))
new.id<-seq(length(a))
a<-cbind(a,new.id)
a<-data.frame(a)
q1<-data.frame()
for(j in 1:length(a[,2])){
  qf$new.id[qf$subjectid==a$a[j]]<-j
q1<-rbind(q1,qf[qf$subjectid==a$a[j],])
} 
glmerfals<-glmer(error~falsification+(1|new.id),data=q1,family=binomial(link="logit"))
glmeraa[i]<-invlogit(fixef(glmerfals)[1])
glmerff[i]<-invlogit(fixef(glmerfals)[1]+fixef(glmerfals)[2])
glmerphi<-glmer(actual.error~error+(1|new.id),data=q1,family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1,family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip[i]<-nova$Chisq[2]
phip[i]<-sqrt(nova$Chisq[2]/length(q1$actual.error))
phi.p[i]<-nova[2,7]
glmershfee<-glmer(shared~falsification+(1|new.id),data=q1,family=binomial(link="logit"))
glmersha[i]<-invlogit(fixef(glmershfee)[1])
glmershf[i]<-invlogit(fixef(glmershfee)[1]+fixef(glmershfee)[2])
glmershatt<-glmer(shared~error+(1|new.id),data=q1,family=binomial(link="logit"))
glmershnerr[i]<-invlogit(fixef(glmershatt)[1])
glmersherr[i]<-invlogit(fixef(glmershatt)[1]+fixef(glmershatt)[2])
}
glmeraa.se<-sd(glmeraa)
glmerff.se<-sd(glmerff)
glmershf.se<-sd(glmershf)
glmersha.se<-sd(glmersha)
glmersherr.se<-sd(glmersherr)
glmershnerr.se<-sd(glmershnerr)
glmerfals<-glmer(error~falsification+(1|subjectid),data=was1,family=binomial(link="logit"))
glmershfee<-glmer(shared~falsification+(1|subjectid),data=was1,family=binomial(link="logit"))
glmershatt<-glmer(shared~error+(1|subjectid),data=was1,family=binomial(link="logit"))
glmerfalsact<-glmer(error~falsification*actual.error+(1|subjectid),data=was1,family=binomial(link="logit"))
###
##total bayes trials##
bayes.trials<-sum(was1$error[was1$falsification==1 & was1$p.fit>0.8])+sum(was1$error[was1$falsification==0 & was1$p.fit<0.2])+length(was1$error[was1$falsification==0 & was1$p.fit<0.8])-sum(was1$error[was1$falsification==1 & was1$p.fit<0.8])+length(was1$error[was1$falsification==0 & was1$p.fit>0.2])-sum(was1$error[was1$falsification==0 & was1$p.fit>0.2])
total.trials<-length(was1$error[was1$falsification==1 & was1$p.fit>0.8])+length(was1$error[was1$falsification==1 & was1$p.fit<0.8])+length(was1$error[was1$falsification==0 & was1$p.fit<0.2])+length(was1$error[was1$falsification==0 & was1$p.fit>0.2])
###
@ 
Unless otherwise noted, all estimation was done using hierarchical logistic models with subject-level varying intercepts \cite{gelman2007data,gelman2010arm}.  The model assumes that multiple observations from the same person are conditionally independent given the subject-specific intercept.  Tests, standard errors, and p-values based on these models were calculated using non-parametric bootstrap with \Sexpr{n1} simulations per statistic \cite{efron1993introduction}.

\subsubsection{Performance}
Participants completed a median of eight trials.  Each participant's task performance score was determined by their final answer, scored on a 5--point scale awarding one point for each element of the rule that they had discovered.  The five elements were: 1) even numbers, 2) consecutive numbers, 3) ascending numbers, 4) the lower bound is 2, and 5) the upper bound is 100.  
%All six participants who scored zero used a mathematical formula that was either unspecific (e.g., $x+2$) or not a rule (e.g., $(2+6)/2=4$).  Among the seven participants with a score of 1, six included even numbers in their answer, and one mentioned ascending numbers.  Of the four participants who scored 2 on the task, two mentioned consecutive even numbers, and two mentioned ascending evens.  The one participant who scored a 3 on the task guessed sequential even numbers less than 100. 

\subsubsection{Attributions to Error}
Replicating \citeA{penner1996trust}, participants judged disconfirming feedback to be error more often (\Sexpr{prettyNum(100*mean(glmerff))}\%; $SE=$ \Sexpr{prettyNum(100*glmerff.se)}\%) than affirming feedback (\Sexpr{prettyNum(100*mean(glmeraa))}\%; $SE=$ \Sexpr{prettyNum(100*glmeraa.se)}\%), $t(162)=3.77$ $p<0.05$, $d=$ 0.30.  In multiple regression, there was only a main effect of feedback type on attributions of error ($t(159)=$ \Sexpr{prettyNum(fixef(glmerfalsact)[2]/sqrt(diag(vcov(glmerfalsact))[2]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerfalsact)[2]/sqrt(diag(vcov(glmerfalsact))[2]),159)*2))}), with no significant main effect of actual error ($t(159)=$ \Sexpr{prettyNum(fixef(glmerfalsact)[3]/sqrt(diag(vcov(glmerfalsact))[3]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerfalsact)[3]/sqrt(diag(vcov(glmerfalsact))[3]),159)*2))}) or interaction between the two factors ($t(159)=$ \Sexpr{prettyNum(fixef(glmerfalsact)[4]/sqrt(diag(vcov(glmerfalsact))[4]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerfalsact)[4]/sqrt(diag(vcov(glmerfalsact))[4]),159)*2))}).  

\subsubsection{Bayesian Consistency}
<<was1cons,echo=false,fig=false,results=hide>>=
#install.packages("quantreg")
#install.packages("ggplot2")
library(ggplot2)
library(quantreg)

wasqa<-subset(was1,falsification==0)
wasqa$error.should<-ifelse(wasqa$p.fit<0.2,1,0)
wasqf<-subset(was1,falsification==1)
wasqf$error.should<-ifelse(wasqf$p.fit>0.8,1,0)

phiaff<-lm(error~error.should,data=wasqa)
phidisc<-lm(error~error.should,data=wasqf)

hd.new<-data.frame(error.should=1)
hc.new<-data.frame(error.should=0)
fd.new<-data.frame(error.should=1)
fc.new<-data.frame(error.should=0)
hd.pred<-predict(phiaff,hd.new,interval="confidence",level=0.95)
hc.pred<-predict(phiaff,hc.new,interval="confidence",level=0.95)
fd.pred<-predict(phidisc,fd.new,interval="confidence",level=0.95)
fc.pred<-predict(phidisc,fc.new,interval="confidence",level=0.95)
png(file="was1cons.png",width=1000,height=1000,res=300)
# Create a simple example dataset 
df <- data.frame(Hindsight= factor(c("Error","Not Error","Error","Not Error")),Probability = c(hd.pred[1],hc.pred[1],fd.pred[1],fc.pred[1]),Feedback = factor(c("Affirming","Affirming","Disconfirming","Disconfirming")),lim.low = c(max(0,hd.pred[2]),max(0,hc.pred[2]),max(0,fd.pred[2]),max(0,fc.pred[2])),lim.high=c(min(1,hd.pred[3]),min(1,hc.pred[3]),min(1,fd.pred[3]),min(1,fc.pred[3]))) 
# Define the top and bottom of the errorbars 1[was3d$incentive==0,]
limits <- aes(ymax = lim.low, ymin=lim.high) 
p <- ggplot(df, aes(colour=Feedback, y=Probability, x=Hindsight),opts(panel.grid.major = theme_bw() ,panel.grid.minor = theme_bw(),panel.background = theme_bw(),axis.ticks = theme_blank())) 
p + geom_crossbar(limits, width=0.1,position="dodge",size=0.3,linetype=1,alpha=1,fatten=5)+scale_y_continuous(limits = c(0,1))+theme_bw()+ylab("Proportion Attributed to Error")+xlab("Bayes' Rule")+scale_colour_manual(values = c("darkred","darkblue"))+opts(legend.position="bottom") 
  dev.off()

share.should<-glmer(shared~actual.error*error+(1|subjectid),data=was1,family=binomial(link="logit"))
@
%\begin{figure}[h] \pause
%    \centering
%\scalebox{1}{\includegraphics[\textwidth]{was1cons}}
%\caption{Proportion of trials attributed to error depending on whether Bayes' Rule dictates participants should attribute the trial to error and whether the feedback was affirming or disconfirming.}
%\label{fig:was1fig}
%\end{figure}

These error attributions were consistent with prior beliefs.  When participants received disconfirming feedback, they correctly attributed \Sexpr{prettyNum(sum(was1$error[was1$falsification==1 & was1$p.fit>0.8]))} of \Sexpr{prettyNum(length(was1$error[was1$falsification==1 & was1$p.fit>0.8]))} trials to error when they strongly expected the triple to fit the rule beforehand ($P(TFTR)>0.8$), and incorrectly attributed \Sexpr{prettyNum(sum(was1$error[was1$falsification==1 & was1$p.fit<0.8]))} of \Sexpr{prettyNum(length(was1$error[was1$falsification==1 & was1$p.fit<0.8]))} trials to error when the strength of their prior beliefs did not justify attributing the feedback to error, ($P(TFTR)<0.8$), $\chi^{2}(1) = \Sexpr{prettyNum(discchip)}$, $p<0.05$, $\phi = \Sexpr{prettyNum(discphip)}$.  When receiving affirming feedback, they correctly attributed \Sexpr{prettyNum(sum(was1$error[was1$falsification==0 & was1$p.fit<0.2]))} of \Sexpr{prettyNum(length(was1$error[was1$falsification==0 & was1$p.fit<0.2]))} trials to error when they strongly expected the triple to not fit the rule beforehand ($P(TFTR)<0.2$), and \Sexpr{prettyNum(sum(was1$error[was1$falsification==0 & was1$p.fit>0.2]))} of \Sexpr{prettyNum(length(was1$error[was1$falsification==0 & was1$p.fit>0.2]))} incorrectly when the strength of their prior beliefs did not justify attributing the feedback to error ($P(TFTR)>0.2$), $\chi^{2}(1)=$ \Sexpr{prettyNum(affchip)}, $p=$ \Sexpr{prettyNum(ptrunc(affphi.p))}, $\phi = \Sexpr{prettyNum(affphip)}$.  However, in multiple regression, there was a main effect of feedback type on attributions of error ($t(159)=$ \Sexpr{prettyNum(fixef(should.error)[3]/sqrt(diag(vcov(should.error))[3]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(should.error)[3]/sqrt(diag(vcov(should.error))[3]),159)*2))}), no significant main effect of Bayes' Rule requiring error attribution ($t(159)=$ \Sexpr{prettyNum(fixef(should.error)[2]/sqrt(diag(vcov(should.error))[2]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(should.error)[2]/sqrt(diag(vcov(should.error))[2]),159)*2))}), and no interaction between the two factors ($t(159)=$ \Sexpr{prettyNum(fixef(should.error)[4]/sqrt(diag(vcov(should.error))[4]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(should.error)[4]/sqrt(diag(vcov(should.error))[4]),159)*2))}).  The overall correlation between their judgments and the consistency criterion was $\phi=$ \Sexpr{prettyNum(phi.ov)}, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi.ov)}, $p<0.05$.

\subsubsection{Accuracy}
Although error attributions were consistent with prior beliefs, they did not match actual error.  When participants believed that feedback was false, it was as likely to be accurate as inaccurate (23\% vs. 29\%), $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(chip))}, $p=$ \Sexpr{prettyNum(ptrunc(mean(phi.p)))}, $\phi=$ \Sexpr{prettyNum(mean(phip))}.

\subsubsection{Data Sharing}
Participants were as likely to share data when feedback affirmed their hypothesis as when it did not, (\Sexpr{prettyNum(100*mean(glmersha))}\%; $SE=$ \Sexpr{prettyNum(100*glmersha.se)}\% vs. \Sexpr{prettyNum(100*mean(glmershf))}\%; $SE=$ \Sexpr{prettyNum(100*glmershf.se)}\%), $t(122)=$ 0.48, $p>$ 0.05.  They were also equally likely to share feedback when they saw it as accurate or inaccurate (\Sexpr{prettyNum(100*mean(glmershnerr))}\%, $SE=$ \Sexpr{prettyNum(100*glmershnerr.se)}\% vs. \Sexpr{prettyNum(100*mean(glmersherr))}\%, $SE=$ \Sexpr{prettyNum(100*glmersherr.se)}\%), $t(122)=$ 0.53, $p>$ 0.05.  When including both main effects and the interaction between actual error and attribution of error to predict whether each trial would be shared, there was neither a significant main effect of error attribution ($t(119)=$ \Sexpr{prettyNum(abs(fixef(share.should)[3]/sqrt(diag(vcov(share.should)))[3]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should)[3]/sqrt(diag(vcov(share.should)))[3],119)*2))}), actual error ($t(119)=$ \Sexpr{prettyNum(abs(fixef(share.should)[2]/sqrt(diag(vcov(share.should)))[2]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should)[2]/sqrt(diag(vcov(share.should)))[2],119)*2))}), or an interaction between the two factors ($t(119)=$ \Sexpr{prettyNum(abs(fixef(share.should)[4]/sqrt(diag(vcov(share.should)))[4]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should)[4]/sqrt(diag(vcov(share.should)))[4],119)*2))}). 

\subsection{Discussion}
The results replicate the findings of \citeA{gorman1989error} and \citeA{penner1996trust}, who found that people are more likely to question feedback when it disconfirms their hypothesis.  For attributions to error, most of these judgments were normatively justified, matching the Bayesian consistency criterion on \Sexpr{bayes.trials} of \Sexpr{total.trials} trials (\Sexpr{prettyNum(100*bayes.trials/total.trials)}\%).  In spite of this consistency, participants were unable to identify actual error.  Finally, on a task new to this study, participants shared information at equal rates regardless of whether the feedback was affirming or disconfirming and regardless of whether it was attributed to error.

The positive test strategy \cite{klayman1987confirmation} entails seeking affirming evidence and discounting disconfirming evidence.  Experiment One found that this strategy is both internally consistent and inaccurate.  Participants were, however, no less likely to share disconfirming or seemingly flawed data.  Although this pattern of data sharing contradicts the positive test strategy, we observed that some participants had difficulty interpreting the open-ended data-sharing question.  Namely, when asked which trials they wanted to share, some responded with a triple (e.g., ``2, 4, 6''), rather than a trial (e.g., ``trial 3'').  Experiment Two addresses this problem by using a fixed response format after each trial rather than an open-ended one at the end.

\section{Experiment Two}
Experiment One replicated the positive test strategy found in previous studies, with participants invoking error more often for disconfirming feedback.  These attributions to error were justified in terms of the consistency criterion, but not the accuracy criterion.  The second experiment examines the effects of incentives on these judgments, using a monetary payoff that encourages participants to convince themselves that they know the rule.  Specifically, participants were offered \$100 for guessing the Actual Rule correctly, and \$1 for concluding that they do not know it.  This incentive scheme sought to encourage motivated reasoning, so that hopeful participants believe that they've reached a correct conclusion rather than assess their knowledge candidly.  

Experiment Two also improves the data-sharing decision.  Immediately after receiving feedback, participants make a binary (Yes--No) decision about whether each trial should be shared.  Having data-sharing decisions at the end of each trial rather than at the end of the experiment sought to make it clearer that the sharing decision applies to the current trial, resolving any ambiguity about whether triples or trials should be shared.  It also elicits sharing judgments earlier in the task, before participants might become tired or frustrated.

\subsection{Method}
\subsubsection{Participants} 
Fifty-eight Carnegie Mellon University undergraduates participated in the experiment for course credit. There were thirty-four women, with average age of 20 years (range: 18 -- 24).

\subsubsection{Design}
Participants were randomly assigned to either the control or the incentive condition.  This was a one-way between-subjects design with two levels. 

\subsubsection{Procedure}
The entire experiment lasted 30 minutes.  Participants were given informed consent, instructions, and the response sheet. At the end of the experiment, they were asked to leave their email address, with the promise that they would be contacted later if they had solved the rule to receive their bonus payment.  This delay of bonus payment was done to prevent participants from telling their friends the correct answer.

\subsubsection{Materials} 
All materials were the same as those in the first study except for the following three changes.  First, participants were given the spreadsheet, but were not required to use it.   

Second, in the financial incentive condition, participants were told: 

\begin{quote}
``At the end of the experiment you will be given a chance to win money by guessing the rule. If you decide to guess the rule you will receive 100 dollars if the guess is exactly correct, but 0 dollars if the guess is incorrect. On the other hand, you can decide that you do not know and receive 1 dollar for sure.''
\end{quote}

Third, decisions to share a trial were made immediately after participants made their attributions to error:  

\begin{quote}
``We are also interested in how people share information. In a future experiment, a new participant will try to discover the same Actual Rule that you are trying to discover. You can share information with this new participant to help him or her solve the Actual Rule.  If the new participant solves the rule, you will receive an additional 50 dollars.'' 
\end{quote}

\begin{flushleft}
The trials were described in the same way as Experiment One, but the sharing judgment was now binary:
\end{flushleft}
\begin{quote}
``Do you think this trial should be shared with a new participant? (Yes/No)''
\end{quote}

\subsection{Results}

<<exp2,results=hide,echo=false,fig=false>>=
incentive.pfit<-lm(p.fit~incentive,data=was2)
pfit.c<-was2$p.fit[was2$incentive==0]
pfit.i<-was2$p.fit[was2$incentive==1]

##Control: Nested Boostrap##
chip<-c()
phip<-c()
phi.p<-c()
glmeraa<-c()
glmerff<-c()
glmershnerr<-c()
glmersherr<-c()
glmersha<-c()
glmershf<-c()
qf<-was2
##For each observation in the dataset make a zero##
qf$new.id<-c(rep(0,length(qf$subjectid)))

for(i in 1:n2){
##obtain the id numbers of subjects we want##
a<-as.numeric(levels(as.factor(qf$subjectid[qf$incentive==0])))
##Sort a sample from these subjects##
a<-sort(sample(a,size=length(levels(as.factor(qf$subjectid[qf$incentive==0]))),replace=TRUE))
##Make some new IDs for the bootstrap sample##
new.id<-seq(length(a))
##Make a data frame holding the old and new ID numbers##
a<-cbind(a,new.id)
a<-data.frame(a)
q1<-data.frame()
####
##For each ID number##
for(j in 1:length(a[,2])){
##The participant with subjectID equal to the jth ID number gets a new id numer equal to j##
  qf$new.id[qf$subjectid==a$a[j]]<-j
  ##Add this new participant to the bootstrapped sample##
q1<-rbind(q1,qf[qf$subjectid==a$a[j],])
} 

glmerfals<-glmer(error~falsification+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmeraa[i]<-invlogit(fixef(glmerfals)[1])
glmerff[i]<-invlogit(fixef(glmerfals)[1]+fixef(glmerfals)[2])

glmerphi<-glmer(actual.error~error+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip[i]<-nova$Chisq[2]
phip[i]<-sqrt(nova$Chisq[2]/length(q1[q1$incentive==0,]$actual.error))
phi.p[i]<-nova[2,7]

glmershfee<-glmer(share~falsification+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmersha[i]<-invlogit(fixef(glmershfee)[1])
glmershf[i]<-invlogit(fixef(glmershfee)[1]+fixef(glmershfee)[2])

glmershatt<-glmer(share~error+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershnerr[i]<-invlogit(fixef(glmershatt)[1])
glmersherr[i]<-invlogit(fixef(glmershatt)[1]+fixef(glmershatt)[2])
}
glmeraa.se<-sd(glmeraa)
glmerff.se<-sd(glmerff)
glmershf.se<-sd(glmershf)
glmersha.se<-sd(glmersha)
glmershnerr.se<-sd(glmershnerr)
glmersherr.se<-sd(glmersherr)
###
##Incentive: Nested Boostrap##
chip.i<-c()
phip.i<-c()
phi.p.i<-c()
glmeraa.i<-c()
glmerff.i<-c()
glmershnerr.i<-c()
glmersherr.i<-c()
glmersha.i<-c()
glmershf.i<-c()
qf<-was2
qf$new.id<-c(rep(0,length(qf$subjectid)))
for(i in 1:n2){
a<-seq(33,58)
a<-sort(sample(a,size=25,replace=TRUE))
new.id<-seq(length(a))
a<-cbind(a,new.id)
a<-data.frame(a)
q1<-data.frame()
for(j in 1:25){
  qf$new.id[qf$subjectid==a$a[j]]<-j
q1<-rbind(q1,qf[qf$subjectid==a$a[j],])
} 
glmerfals.i<-glmer(error~falsification+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmeraa.i[i]<-invlogit(fixef(glmerfals.i)[1])
glmerff.i[i]<-invlogit(fixef(glmerfals.i)[1]+fixef(glmerfals.i)[2])

glmerphi<-glmer(actual.error~error+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.i[i]<-nova$Chisq[2]
phip.i[i]<-sqrt(nova$Chisq[2]/length(q1[q1$incentive==1,]$actual.error))
phi.p.i[i]<-nova[2,7]

glmershfee.i<-glmer(share~falsification+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmersha.i[i]<-invlogit(fixef(glmershfee.i)[1])
glmershf.i[i]<-invlogit(fixef(glmershfee.i)[1]+fixef(glmershfee.i)[2])

glmershatt.i<-glmer(share~error+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershnerr.i[i]<-invlogit(fixef(glmershatt.i)[1])
glmersherr.i[i]<-invlogit(fixef(glmershatt.i)[1]+fixef(glmershatt.i)[2])
}
glmeraa.se.i<-sd(glmeraa.i)
glmerff.se.i<-sd(glmerff.i)
glmershf.se.i<-sd(glmershf.i)
glmersha.se.i<-sd(glmersha.i)
glmershnerr.se.i<-sd(glmershnerr.i)
glmersherr.se.i<-sd(glmersherr.i)
###
##Control: Hierarchical linear model for correlation between prior (P(TFTR)) and error attribution##
wasqa<-was2[c(was2$incentive==0 & was2$falsification==0),]
wasqa$error.should<-ifelse(wasqa$p.fit<0.2,1,0)

glma<-glm(error.should~error,data=wasqa,family=binomial(link="logit"))
chi2a<-glma$null.deviance-glma$deviance
phia<-sqrt(chi2a/length(wasqa$error.should))

wasqf<-was2[c(was2$incentive==0 & was2$falsification==1),]
wasqf$error.should<-ifelse(wasqf$p.fit>0.8,1,0)

glmf<-glm(error.should~error,data=wasqf,family=binomial(link="logit"))
chi2f<-glmf$null.deviance-glmf$deviance
phif<-sqrt(chi2f/length(wasqf$error.should))

wasq<-rbind(wasqa,wasqf)
glmer<-glmer(error.should~error*falsification+(1|subjectid),data=wasq,family=binomial(link="logit"))

wasq<-rbind(wasqa,wasqf)
glmer.ov<-glmer(error.should~error+(1|subjectid),data=wasq,family=binomial(link="logit"))
glmer.ov.null<-glmer(error.should~(1|subjectid),data=wasq,family=binomial(link="logit"))
nova.ov<-anova(glmer.ov.null,glmer.ov)
chi.ov<-nova.ov$Chisq[2]
phi.ov<-sqrt(chi.ov/length(wasq$actual.error))

####
##Incentive: Hierarchical linear model for correlation between prior (P(TFTR)) and error attribution##
wasqa<-was2[c(was2$incentive==1 & was2$falsification==0),]
wasqa$error.should<-ifelse(wasqa$p.fit<0.2,1,0)
lmera.i<-lmer(error.should~error+(1|subjectid),data=wasqa)

phiaff.i<-glmer(error.should~error+(1|subjectid),data=wasqa,family=binomial(link="logit"))
phiaff.null.i<-glmer(error.should~(1|subjectid),data=wasqa,family=binomial(link="logit"))
affnova.i<-anova(phiaff.null.i,phiaff.i)
affchip.i<-affnova.i$Chisq[2]
affphip.i<-sqrt(affnova.i$Chisq[2]/length(wasqa$error.should))
affphi.p.i<-affnova.i[2,7]


wasqf<-was2[c(was2$incentive==1 & was2$falsification==1),]
wasqf$error.should<-ifelse(wasqf$p.fit>0.8,1,0)
lmerf.i<-lmer(error.should~error+(1|subjectid),data=wasqf)

phidisc.i<-glmer(error.should~error+(1|subjectid),data=wasqf,family=binomial(link="logit"))
phidisc.null.i<-glmer(error.should~(1|subjectid),data=wasqf,family=binomial(link="logit"))
discnova.i<-anova(phidisc.null.i,phidisc.i)
discchip.i<-discnova.i$Chisq[2]
discphip.i<-sqrt(discnova.i$Chisq[2]/length(wasqf$error.should))
discphi.p.i<-discnova.i[2,7]

wasq<-rbind(wasqa,wasqf)
glmer.ov.i<-glmer(error.should~error+(1|subjectid),data=wasq,family=binomial(link="logit"))
glmer.ov.null.i<-glmer(error.should~(1|subjectid),data=wasq,family=binomial(link="logit"))
nova.ov.i<-anova(glmer.ov.null.i,glmer.ov.i)
chi.ov.i<-nova.ov.i$Chisq[2]
phi.ov.i<-sqrt(chi.ov.i/length(wasq$actual.error))
####
##Total Bayes Trials##
bayes.control<-sum(was2$error[was2$falsification==1 & was2$p.fit>0.8 & was2$incentive==0])+sum(was2$error[was2$falsification==0 & was2$p.fit<0.2 & was2$incentive==0])+length(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==0])-sum(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==0])+length(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==0])-sum(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==0])

total.control<-length(was2$error[was2$falsification==1 & was2$p.fit>0.8 & was2$incentive==0])+length(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==0])+length(was2$error[was2$falsification==0 & was2$p.fit<0.2 & was2$incentive==0])+length(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==0])

bayes.incentive<-sum(was2$error[was2$falsification==1 & was2$p.fit>0.8 & was2$incentive==1])+sum(was2$error[was2$falsification==0 & was2$p.fit<0.2 & was2$incentive==1])+length(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==1])-sum(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==1])+length(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==1])-sum(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==1])

total.incentive<-length(was2$error[was2$falsification==1 & was2$p.fit>0.8 & was2$incentive==1])+length(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==1])+length(was2$error[was2$falsification==0 & was2$p.fit<0.2 & was2$incentive==1])+length(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==1])
####
total.trials<-c()
condition<-c()
for(i in levels(as.factor(was2$subjectid))){
total.trials[i]<-max(was2$trial.num[was2$subjectid==i])
condition[i]<-was2$incentive[was2$subjectid==i][1]
}
was2trials<-data.frame(total.trials,condition)
rqr<-wilcox.test(was2trials$total.trials~was2trials$condition)
glmerfalsact<-glmer(error~falsification*actual.error*incentive+(1|subjectid),data=was2,family=binomial(link="logit"))
@ 

\subsubsection{Incentives and Performance}
<<trials,echo=false,fig=false,results=hide>>=
exp1trials<-c(1,1,1,1,1,3,5,6,8,8,9,13,17,18,19,22,41)
exp2trials.c<-c(1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,4,5,5,5,5,6,7,7,7,7,11,11,11,12,13,15,19)
exp2trials.i<-c(1,1,1,2,3,3,3,4,4,5,6,7,8,10,11,11,13,15,16,16,19,19,24,29,38,42)
ks1<-ks.test(exp1trials,exp2trials.c)
ks2<-ks.test(exp2trials.i,exp2trials.c)
@ 

Incentives doubled the median number of trials from \Sexpr{prettyNum(median(was2trials$total.trials[was2trials$condition==0]))} to \Sexpr{prettyNum(median(was2trials$total.trials[was2trials$condition==1]))}.\footnote{Although the median number of trials increased, a non-parametric Kolmogorov-Smirnov (KS) test for differences in empirical cumulative distributions indicates no differences in distribution.  Between Experiment One and the control condition of Experiment Two, the KS test was $D=$ \Sexpr{prettyNum(ks1$statistic)}, $p=$ \Sexpr{prettyNum(ks1$p.value)}.  Between Experiment Two control and incentive conditions, the KS test was $D=$ \Sexpr{prettyNum(ks2$statistic)}, $p=$ \Sexpr{prettyNum(ks2$p.value)}.  Thus, although the medians were different, the distributions of trials between the studies and conditions were similar.}  Using the same scoring method as Experiment One, those in the incentive condition scored about the same on average ($M=1.58$, $SD=1.21$) as those in the control condition ($M=1.66$, $SD=1.21$), $t(56)=$ 0.80, $p>$ 0.05.  One participant solved the rule exactly, and was compensated with a \$99 Amazon gift card.

\subsubsection{Attributions to Error}
As in Experiment One, those in the control condition were significantly more likely to see feedback as error when it was disconfirming (\Sexpr{prettyNum(100*mean(glmerff))}\%, $SE=$ \Sexpr{prettyNum(100*glmerff.se)}\%), than when it was affirming (\Sexpr{prettyNum(100*mean(glmeraa))}\%, $SE=$ \Sexpr{prettyNum(100*glmeraa.se)}\%), $t(171)=$ 2.89, $p<$ 0.05, $d=$ 0.22.  In contrast, participants in the incentive condition were equally likely to attribute error to disconfirming feedback (\Sexpr{prettyNum(100*mean(glmerff.i))}\%, $SE=$ \Sexpr{prettyNum(100*glmerff.se.i)}\%) and to affirming feedback (\Sexpr{prettyNum(100*mean(glmeraa.i))}\%, $SE=$ \Sexpr{prettyNum(100*glmeraa.se.i)}\%), $t(309)=$ 0.62, $p>$ 0.05, $d=$ 0.04.  Thus, although we expected the incentives to increase motivated reasoning, they appeared to reduce the tendency for participants to attribute disconfirming results to error.  In multiple regression, there was a significant main effect of feedback type ($t(476)=$ \Sexpr{prettyNum(fixef(glmerfalsact)[2]/sqrt(diag(vcov(glmerfalsact))[2]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerfalsact)[2]/sqrt(diag(vcov(glmerfalsact))[2]),476)*2))}), incentive ($t(476)=$ \Sexpr{prettyNum(fixef(glmerfalsact)[4]/sqrt(diag(vcov(glmerfalsact))[4]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerfalsact)[4]/sqrt(diag(vcov(glmerfalsact))[4]),476)*2))}), and a significant interaction between the two factors, where disconfirming feedback only increased error attributions for those in the control condition ($t(476)=$ \Sexpr{prettyNum(abs(fixef(glmerfalsact)[6]/sqrt(diag(vcov(glmerfalsact))[6])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerfalsact)[6]/sqrt(diag(vcov(glmerfalsact))[6]),476)*2))}).  There were no other main effects, two-way, or three-way interactions between feedback type, incentive condition, and actual error.\footnote{This reversal of error attributions may be partially explained by the implied difficulty of the rule.  Participants in the incentive condition expected their triples to fit the rule less often ($M=$ \Sexpr{prettyNum(mean(pfit.i))}, $SD=$ \Sexpr{prettyNum(sd(pfit.i))}) than those in the control condition, ($M=$ \Sexpr{prettyNum(mean(pfit.c))}, $SD=$ \Sexpr{prettyNum(sd(pfit.c))}), $t(\Sexpr{incentive.pfit$df.residual})=$ \Sexpr{prettyNum(coefficients(incentive.pfit)[2]/sqrt(diag(vcov(incentive.pfit))[2]))}, $p=$ \Sexpr{prettyNum(dt(coefficients(incentive.pfit)[2]/sqrt(diag(vcov(incentive.pfit)))[2],incentive.pfit$df.residual))}.}

\subsubsection{Bayesian Consistency}

<<was2cons,echo=false,fig=false,results=hide>>=
#install.packages("quantreg")
#install.packages("ggplot2")
library(ggplot2)
library(quantreg)

wasqa<-was2[c(was2$incentive==0 & was2$falsification==0),]
wasqa$error.should<-ifelse(wasqa$p.fit<0.2,1,0)
wasqf<-was2[c(was2$incentive==0 & was2$falsification==1),]
wasqf$error.should<-ifelse(wasqf$p.fit>0.8,1,0)

wasqa.i<-was2[c(was2$incentive==1 & was2$falsification==0),]
wasqa.i$error.should<-ifelse(wasqa.i$p.fit<0.2,1,0)
wasqf.i<-was2[c(was2$incentive==1 & was2$falsification==1),]
wasqf.i$error.should<-ifelse(wasqf.i$p.fit>0.8,1,0)

phiaff<-lm(error~error.should,data=wasqa)
phidisc<-lm(error~error.should,data=wasqf)
phiaff.i<-lm(error~error.should,data=wasqa.i)
phidisc.i<-lm(error~error.should,data=wasqf.i)

hd.new<-data.frame(error.should=1)
hc.new<-data.frame(error.should=0)
fd.new<-data.frame(error.should=1)
fc.new<-data.frame(error.should=0)
hd.pred<-predict(phiaff,hd.new,interval="confidence",level=0.95)
hc.pred<-predict(phiaff,hc.new,interval="confidence",level=0.95)
fd.pred<-predict(phidisc,fd.new,interval="confidence",level=0.95)
fc.pred<-predict(phidisc,fc.new,interval="confidence",level=0.95)
hd.pred.i<-predict(phiaff.i,hd.new,interval="confidence",level=0.95)
hc.pred.i<-predict(phiaff.i,hc.new,interval="confidence",level=0.95)
fd.pred.i<-predict(phidisc.i,fd.new,interval="confidence",level=0.95)
fc.pred.i<-predict(phidisc.i,fc.new,interval="confidence",level=0.95)

png(file="was2cons.png",width=1000,height=1000,res=300)
# Create a simple example dataset 
df <- data.frame(Incentive= factor(c("Control","Control","Control","Control","Incentive","Incentive","Incentive","Incentive")),Hindsight= factor(c("Error","Not Error","Error","Not Error","Error","Not Error","Error","Not Error")),Probability = c(hd.pred[1],hc.pred[1],fd.pred[1],fc.pred[1],hd.pred.i[1],hc.pred.i[1],fd.pred.i[1],fc.pred.i[1]),Feedback = factor(c("Affirming","Affirming","Disconfirming","Disconfirming","Affirming","Affirming","Disconfirming","Disconfirming")),lim.low = c(max(0,hd.pred[2]),max(0,hc.pred[2]),max(0,fd.pred[2]),max(0,fc.pred[2]),max(0,hd.pred.i[2]),max(0,hc.pred.i[2]),max(0,fd.pred.i[2]),max(0,fc.pred.i[2])),lim.high=c(min(1,hd.pred[3]),min(1,hc.pred[3]),min(1,fd.pred[3]),min(1,fc.pred[3]),min(1,hd.pred.i[3]),min(1,hc.pred.i[3]),min(1,fd.pred.i[3]),min(1,fc.pred.i[3])))
# Define the top and bottom of the errorbars 1[was3d$incentive==0,]
limits <- aes(ymax = lim.low, ymin=lim.high) 
p <- ggplot(df, aes(colour=Feedback, y=Probability, x=Hindsight),opts(panel.grid.major = theme_bw() ,panel.grid.minor = theme_bw(),panel.background = theme_bw(),axis.ticks = theme_blank())) 
p + geom_crossbar(limits, width=0.1,position="dodge",size=0.3,linetype=1,alpha=1,fatten=5)+scale_y_continuous(limits = c(0,1))+theme_bw()+ylab("Proportion Attributed to Error")+xlab("Bayes' Rule")+scale_colour_manual(values = c("darkred","darkblue"))+facet_grid(.~Incentive)+opts(legend.position="bottom")
  dev.off()

share.should<-glmer(share~actual.error*error*incentive+(1|subjectid),data=was2,family=binomial(link="logit"))
@

%\begin{figure}[h] \pause
%    \centering
%\scalebox{1}{\includegraphics[\textwidth]{was2cons}}
%\caption[Experiment Two Trials Attributed to Error Compared to Bayes' Rule]{Proportion of trials attributed to error depending on whether Bayes' Rule predicted error attribution and whether the feedback was affirming or disconfirming.}
%\label{fig:was2fig}
%\end{figure}
%As seen in Figure~\ref{fig:was2fig}, 
Attributions to error for participants in the control condition were consistent with their prior beliefs.  For affirming feedback, they correctly attributed \Sexpr{prettyNum(sum(was2$error[was2$falsification==0 & was2$p.fit<0.2 & was2$incentive==0]))} of \Sexpr{prettyNum(length(was2$error[was2$falsification==0 & was2$p.fit<0.2 & was2$incentive==0]))} trials to error and incorrectly attributed \Sexpr{prettyNum(sum(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==0]))} of \Sexpr{prettyNum(length(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==0]))} trials to error, $\chi^{2}(1) = \Sexpr{prettyNum(chi2a)}$, $p=$ \Sexpr{prettyNum(ptrunc(dchisq(chi2a,1)*2))}, $\phi=$ \Sexpr{prettyNum(phia)}.\footnote{A hierarchical model could not be used for the control condition.  Only one participant both made an attribution to error and should have not made an attribution to error.  Thus, only one subject-level intercept could be fit, as all other participants had zero probability of judging error.  To deal with this we pool all of the data together to get an approximate answer.}  For disconfirming feedback they correctly attributed \Sexpr{prettyNum(sum(was2$error[was2$falsification==1 & was2$p.fit>0.8 & was2$incentive==0]))} of \Sexpr{prettyNum(length(was2$error[was2$falsification==1 & was2$p.fit>0.8 & was2$incentive==0]))} trials to error and incorrectly attributed \Sexpr{prettyNum(sum(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==0]))} of \Sexpr{prettyNum(length(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==0]))} trials to error, $\chi^{2}(1) = \Sexpr{prettyNum(chi2f)}$, $p<0.05$, $\phi = \Sexpr{prettyNum(phif)}$.  The overall correlation between their attributions to error and the consistency criterion was $\phi=$ \Sexpr{prettyNum(phi.ov)}, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi.ov)}, $p=$ \Sexpr{prettyNum(ptrunc(dchisq(chi.ov,1)*2))}.

Participants in the incentive condition exhibited similar consistency.  For affirming feedback, they correctly attributed \Sexpr{prettyNum(sum(was2$error[was2$falsification==0 & was2$p.fit<0.2 & was2$incentive==1]))} of \Sexpr{prettyNum(length(was2$error[was2$falsification==0 & was2$p.fit<0.2 & was2$incentive==1]))} trials to error and incorrectly attributed \Sexpr{prettyNum(sum(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==1]))} of \Sexpr{prettyNum(length(was2$error[was2$falsification==0 & was2$p.fit>0.2 & was2$incentive==1]))} trials to error, $\chi^{2}(1)=$ \Sexpr{prettyNum(affchip.i)}, $p=$ \Sexpr{prettyNum(ptrunc(affphi.p.i))}, $\phi = \Sexpr{prettyNum(affphip.i)}$.  For disconfirming feedback they attributed \Sexpr{prettyNum(sum(was2$error[was2$falsification==1 & was2$p.fit>0.8 & was2$incentive==1]))} of \Sexpr{prettyNum(length(was2$error[was2$falsification==1 & was2$p.fit>0.8 & was2$incentive==1]))} trials to error correctly and incorrectly attributed \Sexpr{prettyNum(sum(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==1]))} of \Sexpr{prettyNum(length(was2$error[was2$falsification==1 & was2$p.fit<0.8 & was2$incentive==1]))} trials to error, $\chi^{2}(1) = \Sexpr{prettyNum(discchip.i)}$, $p<0.05$, $\phi = \Sexpr{prettyNum(discphip.i)}$.  The overall correlation between their error attributions and the consistency criterion was $\phi = \Sexpr{prettyNum(phi.ov.i)}$, $\chi^{2}(1) = \Sexpr{prettyNum(chi.ov.i)}$, $p=\Sexpr{prettyNum(ptrunc(dchisq(chi.ov.i,1)*2))}$.

\subsubsection{Accuracy}

As in Experiment One, participants in the control condition were unable to identify when actual errors occurred.  They correctly identified 26\% of actual errors and incorrectly identified 20\% of non-errors as error, $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(chip))}, $p=$ \Sexpr{prettyNum(ptrunc(mean(phi.p)))}, $\phi=$ \Sexpr{prettyNum(mean(phip))}.  For the incentive condition, participants were also unable to identify actual error.  They correctly identified 21\% of actual errors and incorrectly identified 21\% of non-errors as error, $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(chip.i))}, $p=$ \Sexpr{prettyNum(ptrunc(mean(phi.p.i)))}, $\phi=$ \Sexpr{prettyNum(mean(phip.i))}.

\subsubsection{Data Sharing}

In contrast to Experiment One, participants in the control condition shared a smaller proportion of trials when the feedback was disconfirming (\Sexpr{prettyNum(100*mean(glmershf))}\%, $SE=$ \Sexpr{prettyNum(100*glmershf.se)}\%) than when it was affirming (\Sexpr{prettyNum(100*mean(glmersha))}\%, $SE=$ \Sexpr{prettyNum(100*glmersha.se)}\%), $t(171)$ = 1.96, $p=$ 0.05, $d=$ 0.15.  Similarly, they shared a smaller proportion of trials when they judged the feedback to be an error (\Sexpr{prettyNum(100*mean(glmersherr))}\%, $SE=$ \Sexpr{prettyNum(100*glmersherr.se)}\%) than when they judged it to be accurate (\Sexpr{prettyNum(100*mean(glmershnerr))}\%, $SE=$ \Sexpr{prettyNum(100*glmershnerr.se)}\%), $t(171)=$ 1.98, $p<$ 0.05, $d=$ 0.15.  Participants in the incentive condition also shared a smaller proportion of trials when the feedback was disconfirming (\Sexpr{prettyNum(100*mean(glmershf.i))}\%, $SE=$ \Sexpr{prettyNum(100*glmershf.se.i)}\%), than when it was affirming (\Sexpr{prettyNum(100*mean(glmersha.i))}\%, $SE=$ \Sexpr{prettyNum(100*glmersha.se.i)}\%), $t(309)=$ 2.95, $p<$ 0.05, $d=$ 0.17.  They also shared a smaller proportion of trials when they judged the feedback to be an error (\Sexpr{prettyNum(100*mean(glmersherr.i))}\%, $SE=$ \Sexpr{prettyNum(100*glmersherr.se.i)}\%) than when they judged the feedback to be accurate (\Sexpr{prettyNum(100*mean(glmershnerr.i))}\%, $SE=$ \Sexpr{prettyNum(100*glmershnerr.se.i)}\%), $t(309)=$ 3.94, $p<$ 0.05, $d=$ 0.22.  

In multiple regression, there was only a significant main effect of error attribution ($t(476)=$ \Sexpr{prettyNum(abs(fixef(share.should)[3]/sqrt(diag(vcov(share.should)))[3]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should)[3]/sqrt(diag(vcov(share.should)))[3],476)))}), and a marginally significant interaction between actual error and incentive condition, such that those in the incentive condition were more likely to share actual errors than those in the control condition ($t(476)=$ \Sexpr{prettyNum(abs(fixef(share.should)[6]/sqrt(diag(vcov(share.should)))[6]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should)[6]/sqrt(diag(vcov(share.should)))[6],476)))}).  There were no other main effects, two-way, or three-way interactions between feedback type, actual error, and incentive condition. 

\subsection{Discussion}

Experiment Two again found that participants more often attribute error to disconfirming feedback when given no incentive beyond their intrinsic motivation to solve the problem.  However, participants who were offered a large incentive for getting the rule attributed error to affirming and disconfirming feedback at equal rates.  Although we had expected the incentive for getting the rule to increase motivated reasoning, it actually reduced the tendency for participants to attribute disconfirming feedback to error.  It did not, however, lead to error attributions that were either more accurate or more consistent with prior expectations.  Participants in the control condition met the consistency criterion on \Sexpr{bayes.control} of \Sexpr{total.control} trials (\Sexpr{prettyNum(100*bayes.control/total.control)}\%), which was a higher rate than those in the incentive condition (\Sexpr{bayes.incentive} of \Sexpr{total.incentive} trials, \Sexpr{prettyNum(100*bayes.incentive/total.incentive)}\%).  One possible explanation is that the incentive helped participants maintain a more balanced perspective on the likelihood of error after receiving feedback; however, in spite of their motivation, they lacked the understanding (e.g., of Bayes' Rule) needed to respond consistently. An alternative explanation is that participants in the incentive condition rushed through the prior probability and error attribution questions in order to complete more trials, thereby creating more chances to propose triples and get feedback.  This strategy would reduce consistency and make attributions of error more equal across feedback types, and is consistent with the finding that participants in the incentive condition completed twice as many trials in the same time period as those in the control condition.

For both the control and the incentive groups, participants shared disconfirming feedback less frequently than affirming feedback.  They also shared feedback that they attributed to error less frequently than feedback that they saw as accurate.  Those error attributions were loosely justified by internal consistency, but not by accuracy.  Extrapolating to scientific contexts, researchers may have defensible reasons to omit data from publication based on their expectations, but that this consistency may not prevent harm to those who must use the data.  Before reaching that conclusion, we address one possible artifact in Experiment Two's procedure: placing the sharing decision immediately after the error attribution task, perhaps suggesting that the two should be related.  Experiment Three remedies this possible confound by eliciting data sharing decisions and error attributions both during each trial and at the end of the task, also allowing participants to reflect on all the data before making their final error attributions and data-sharing decisions.

Finally, Experiment Two's incentive scheme sought to motivate participants to believe they knew the rule.  However, the value of data are usually determined not by the person who collects the data themselves, but by others, such as reviewers (for journals) or regulatory bodies (for drug approval).  These people, who are external to the data collection process, determine the reward to the researcher based on their prior beliefs and their evaluation of the data shared with them.  To simulate this incentive system more closely, Experiment Three uses the natural expectations that participants have about how to convince another person.  We expect that an incentive to convince another person should increase the preference for discounting disconfirming feedback.

\section{Experiment Three}

Experiment Three replicates Experiment Two with several modifications.  Most importantly, a new condition provides an incentive for participants to convince another person that their proposed Final Answer is correct, with data-sharing as the sole mode of communication between them.  To do this, we embed the Wason task in a teacher--learner game, a type of principal--agent game \cite{fudenberg1991game,shaftoepistemic}.  In this task, the participant collecting the data (the teacher) shares data with another person (the learner) who has to guess the rule based on the data that the teacher decides to share.  

The teacher is in one of two incentive conditions.  The \emph{compatible} incentive condition rewards both the teacher and learner if the learner guesses the rule.  In the \emph{perverse} incentive condition, the learner's rewards remain the same, but the teacher receives money if the learner accepts the teacher's Final Answer.  Thus, the perverse incentive allows the teacher to distort the data supplied to the learner, potentially increasing her own payoff while reducing the learner's reward.  In this scenario, the teacher knows the entire game structure, but the learner does not.  Specifically, the learner is not told that the teacher does not have to share all the trials that were conducted, and the teacher is told that the learner only knows about the shared trials.

Experiment Three also deals with two methodological issues brought up in Experiment Two.  One is that participants in the incentive condition attributed affirmation and disconfirmation to error equally, but were slightly less consistent in their attributions to error than participants in the control condition.  This may have reflected their rushing through the task to complete more trials.  To reduce this threat, we use a penalty for making incorrect prior probability and error attributions.  Any payoff to the participant is reduced in proportion to their inaccuracy on these two measures.  This penalty prevents them from performing one element of the task well (collecting many trials) at the cost of the other elements (rushing through attributions to error).  The second was the possibility that participants assumed that the data sharing and error attribution judgments should be related because they occurred sequentially on each trial.  This could create a false correlation between the two measures based on the participant's belief that the experimenter put the two questions close to each other for a reason.  To deal with this, we also elicit data sharing decisions and attributions to error at the end of the task, using a fixed-response format rather than the open-ended format used in Experiment One.

\subsection{Method}

<<exp3,results=hide,echo=false,fig=false>>=
a<-(356+cumsum(rep(c(4,2,1,1,1,1,1,1),37)))
b<-c(1,6,8,9,18,21:24,27,31,34:38,41,45,48:52,55,318,320,322,323,326,328:334,337,339:345,348,350:356)
c<-append(b,a)
c<-append(c,c(804,977:1062,1065,1066,1098))
was3.t<-read.csv("Wason_Cumulative_Info.csv",na.string="",skip=2,header=FALSE)
was3<-was3.t[1:length(was3.t[,1]),c]
  
g1<-c("subjectid","IP","start","end","open1","trial1.1","trial1.2","trial1.3","trial1.p.fit","trial1.feedback","open2","trial2.false","trial2.1","trial2.2","trial2.3","trial2.p.fit","trial2.feedback","open3","trial3.false","trial3.1","trial3.2","trial3.3","trial3.p.fit","trial3.feedback","bonus.self.perverse","bonus.other.perverse","bonus.self.compatible","bonus.other.compatible","open4","trial4.feedback","trial4.false","trial4.share","trial4.1","trial4.2","trial4.3","trial4.p.fit","open5","trial5.feedback","trial5.false","trial5.share","trial5.1","trial5.2","trial5.3","trial5.p.fit","open6","trial6.feedback","trial6.false","trial6.share","trial6.1","trial6.2","trial6.3","trial6.p.fit","open7","trial7.feedback","trial7.false","trial7.share","trial7.1","trial7.2","trial7.3","trial7.p.fit","open8","trial8.feedback","trial8.false","trial8.share","trial8.1","trial8.2","trial8.3","trial8.p.fit","open9","trial9.feedback","trial9.false","trial9.share","trial9.1","trial9.2","trial9.3","trial9.p.fit")
g1<-c(g1,c("open10","trial10.feedback","trial10.false","trial10.share","trial10.1","trial10.2","trial10.3","trial10.p.fit","open11","trial11.feedback","trial11.false","trial11.share","trial11.1","trial11.2","trial11.3","trial11.p.fit","open12","trial12.feedback","trial12.false","trial12.share","trial12.1","trial12.2","trial12.3","trial12.p.fit","open13","trial13.feedback","trial13.false","trial13.share","trial13.1","trial13.2","trial13.3","trial13.p.fit","open14","trial14.feedback","trial14.false","trial14.share","trial14.1","trial14.2","trial14.3","trial14.p.fit","open15","trial15.feedback","trial15.false","trial15.share","trial15.1","trial15.2","trial15.3","trial15.p.fit","open16","trial16.feedback","trial16.false","trial16.share","trial16.1","trial16.2","trial16.3","trial16.p.fit","open17","trial17.feedback","trial17.false","trial17.share","trial17.1","trial17.2","trial17.3","trial17.p.fit","open18","trial18.feedback","trial18.false","trial18.share","trial18.1","trial18.2","trial18.3","trial18.p.fit","open19","trial19.feedback","trial19.false","trial19.share","trial19.1","trial19.2","trial19.3","trial19.p.fit","open20","trial20.feedback","trial20.false","trial20.share","trial20.1","trial20.2","trial20.3","trial20.p.fit","open21","trial21.feedback","trial21.false","trial21.share","trial21.1","trial21.2","trial21.3","trial21.p.fit","open22","trial22.feedback","trial22.false","trial22.share","trial22.1","trial22.2","trial22.3","trial22.p.fit","open23","trial23.feedback","trial23.false","trial23.share","trial23.1","trial23.2","trial23.3","trial23.p.fit","open24","trial24.feedback","trial24.false","trial24.share","trial24.1","trial24.2","trial24.3","trial24.p.fit"))
g1<-c(g1,c("open25","trial25.feedback","trial25.false","trial25.share","trial25.1","trial25.2","trial25.3","trial25.p.fit","open26","trial26.feedback","trial26.false","trial26.share","trial26.1","trial26.2","trial26.3","trial26.p.fit","open27","trial27.feedback","trial27.false","trial27.share","trial27.1","trial27.2","trial27.3","trial27.p.fit","open28","trial28.feedback","trial28.false","trial28.share","trial28.1","trial28.2","trial28.3","trial28.p.fit","open29","trial29.feedback","trial29.false","trial29.share","trial29.1","trial29.2","trial29.3","trial29.p.fit","open30","trial30.feedback","trial30.false","trial30.share","trial30.1","trial30.2","trial30.3","trial30.p.fit","open31","trial31.feedback","trial31.false","trial31.share","trial31.1","trial31.2","trial31.3","trial31.p.fit","open32","trial32.feedback","trial32.false","trial32.share","trial32.1","trial32.2","trial32.3","trial32.p.fit","open33","trial33.feedback","trial33.false","trial33.share","trial33.1","trial33.2","trial33.3","trial33.p.fit","open34","trial34.feedback","trial34.false","trial34.share","trial34.1","trial34.2","trial34.3","trial34.p.fit","open35","trial35.feedback","trial35.false","trial35.share","trial35.1","trial35.2","trial35.3","trial35.p.fit","open36","trial36.feedback","trial36.false","trial36.share","trial36.1","trial36.2","trial36.3","trial36.p.fit"))
g1<-c(g1,c("open37","trial37.feedback","trial37.false","trial37.share","trial37.1","trial37.2","trial37.3","trial37.p.fit","open38","trial38.feedback","trial38.false","trial38.share","trial38.1","trial38.2","trial38.3","trial38.p.fit","open39","trial39.feedback","trial39.false","trial39.share","trial39.1","trial39.2","trial39.3","trial39.p.fit","open40","trial40.feedback","trial40.false","trial40.share","trial40.1","trial40.2","trial40.3","trial40.p.fit","open41","trial41.feedback","trial41.false","trial41.share","trial41.1","trial41.2","trial41.3","trial41.p.fit","open42","trial42.feedback","trial42.false","trial42.share","trial42.1","trial42.2","trial42.3","trial42.p.fit","open43","trial43.feedback","trial43.false","trial43.share","trial43.1","trial43.2","trial43.3","trial43.p.fit","final.answer","trial1.false.final","trial2.false.final","trial3.false.final","trial4.false.final","trial5.false.final","trial6.false.final","trial7.false.final","trial8.false.final","trial9.false.final","trial10.false.final"))
g1<-c(g1,c("trial11.false.final","trial12.false.final","trial13.false.final","trial14.false.final","trial15.false.final","trial16.false.final","trial17.false.final","trial18.false.final","trial19.false.final","trial20.false.final","trial21.false.final","trial22.false.final","trial23.false.final","trial24.false.final","trial25.false.final","trial26.false.final","trial27.false.final","trial28.false.final","trial29.false.final","trial30.false.final","trial31.false.final","trial32.false.final","trial33.false.final","trial34.false.final","trial35.false.final","trial36.false.final","trial37.false.final","trial38.false.final","trial39.false.final","trial40.false.final","trial41.false.final","trial42.false.final","trial43.false.final","trial1.share.final","trial2.share.final","trial3.share.final","trial4.share.final","trial5.share.final","trial6.share.final","trial7.share.final","trial8.share.final","trial9.share.final","trial10.share.final","trial11.share.final","trial12.share.final","trial13.share.final","trial14.share.final","trial15.share.final","trial16.share.final","trial17.share.final","trial18.share.final","trial19.share.final","trial20.share.final","trial21.share.final","trial22.share.final","trial23.share.final","trial24.share.final","trial25.share.final","trial26.share.final","trial27.share.final","trial28.share.final","trial29.share.final","trial30.share.final","trial31.share.final","trial32.share.final","trial33.share.final","trial34.share.final","trial35.share.final","trial36.share.final","trial37.share.final","trial38.share.final","trial39.share.final","trial40.share.final","trial41.share.final","trial42.share.final","trial43.share.final","gender","age","incentive"))

colnames(was3)<-g1

b<-matrix(NA,nrow=1,ncol=13)
b<-data.frame(b)
colnames(b)<-c("name","trial","open","feedback","error","share","num1","num2","num3","p.fit","false.final","share.final","incentive")
was3d<-b
was3d<-was3d[-1,]

write.table(was3[,c("final.answer","subjectid")],"was3d.answer.csv",sep=",")
scores<-read.csv("was3d.answer-1.csv",na.string="")
scores<-scores[,c("subjectid","ascending","consecutive","evens","lower.two","Upper.100","score")]

for(i in 1:length(levels(as.factor(was3$subjectid)))){
name<-as.factor(rep(was3$subjectid[i],43))
final.answer<-as.factor(rep(was3$final.answer[i],43))
trial<-seq(1,43)
incentive<-rep(was3$incentive[was3$subjectid[i]],43)

score<-rep(scores$score[scores$subjectid==was3$subjectid[i]],43)
ascending<-rep(scores$ascending[scores$subjectid==was3$subjectid[i]],43)
consecutive<-rep(scores$consecutive[scores$subjectid==was3$subjectid[i]],43)
even<-rep(scores$evens[scores$subjectid==was3$subjectid[i]],43)
lower<-rep(scores$lower.two[scores$subjectid==was3$subjectid[i]],43)
upper<-rep(scores$Upper.100[scores$subjectid==was3$subjectid[i]],43)

open<-c(was3$open1[i],was3$open2[i],was3$open3[i],was3$open4[i],was3$open5[i],was3$open6[i],was3$open7[i],was3$open8[i],was3$open9[i],was3$open10[i],was3$open11[i],was3$open12[i],was3$open13[i],was3$open14[i],was3$open15[i],was3$open16[i],was3$open17[i],was3$open18[i],was3$open19[i],was3$open20[i],was3$open21[i],was3$open22[i],was3$open23[i],was3$open24[i],was3$open25[i],was3$open26[i],was3$open27[i],was3$open28[i],was3$open29[i],was3$open30[i],was3$open31[i],was3$open32[i],was3$open33[i],was3$open34[i],was3$open35[i],was3$open36[i],was3$open37[i],was3$open38[i],was3$open39[i],was3$open40[i],was3$open41[i],was3$open42[i],was3$open43[i])

q<-c("FIT","DNF")

feedback<-c(factor(was3$trial1.feedback[i],levels=q),factor(was3$trial2.feedback[i],levels=q),factor(was3$trial3.feedback[i],levels=q),factor(was3$trial4.feedback[i],levels=q),factor(was3$trial5.feedback[i],levels=q),factor(was3$trial6.feedback[i],levels=q),factor(was3$trial7.feedback[i],levels=q),factor(was3$trial8.feedback[i],levels=q),factor(was3$trial9.feedback[i],levels=q),factor(was3$trial10.feedback[i],levels=q),factor(was3$trial11.feedback[i],levels=q),factor(was3$trial12.feedback[i],levels=q),factor(was3$trial13.feedback[i],levels=q),factor(was3$trial14.feedback[i],levels=q),factor(was3$trial15.feedback[i],levels=q),factor(was3$trial16.feedback[i],levels=q),factor(was3$trial17.feedback[i],levels=q),factor(was3$trial18.feedback[i],levels=q),factor(was3$trial19.feedback[i],levels=q),factor(was3$trial20.feedback[i],levels=q),factor(was3$trial21.feedback[i],levels=q),factor(was3$trial22.feedback[i],levels=q),factor(was3$trial23.feedback[i],levels=q),factor(was3$trial24.feedback[i],levels=q),factor(was3$trial25.feedback[i],levels=q),factor(was3$trial26.feedback[i],levels=q),factor(was3$trial27.feedback[i],levels=q),factor(was3$trial28.feedback[i],levels=q),factor(was3$trial29.feedback[i],levels=q),factor(was3$trial30.feedback[i],levels=q),factor(was3$trial31.feedback[i],levels=q),factor(was3$trial32.feedback[i],levels=q),factor(was3$trial33.feedback[i],levels=q),factor(was3$trial34.feedback[i],levels=q),factor(was3$trial35.feedback[i],levels=q),factor(was3$trial36.feedback[i],levels=q),factor(was3$trial37.feedback[i],levels=q),factor(was3$trial38.feedback[i],levels=q),factor(was3$trial39.feedback[i],levels=q),factor(was3$trial40.feedback[i],levels=q),factor(was3$trial41.feedback[i],levels=q),factor(was3$trial42.feedback[i],levels=q),factor(was3$trial43.feedback[i],levels=q))

error<-c(NA,was3$trial2.false[i],was3$trial3.false[i],was3$trial4.false[i],was3$trial5.false[i],was3$trial6.false[i],was3$trial7.false[i],was3$trial8.false[i],was3$trial9.false[i],was3$trial10.false[i],was3$trial11.false[i],was3$trial12.false[i],was3$trial13.false[i],was3$trial14.false[i],was3$trial15.false[i],was3$trial16.false[i],was3$trial17.false[i],was3$trial18.false[i],was3$trial19.false[i],was3$trial20.false[i],was3$trial21.false[i],was3$trial22.false[i],was3$trial23.false[i],was3$trial24.false[i],was3$trial25.false[i],was3$trial26.false[i],was3$trial27.false[i],was3$trial28.false[i],was3$trial29.false[i],was3$trial30.false[i],was3$trial31.false[i],was3$trial32.false[i],was3$trial33.false[i],was3$trial34.false[i],was3$trial35.false[i],was3$trial36.false[i],was3$trial37.false[i],was3$trial38.false[i],was3$trial39.false[i],was3$trial40.false[i],was3$trial41.false[i],was3$trial42.false[i],was3$trial43.false[i])

share<-c(NA,NA,NA,was3$trial4.share[i],was3$trial5.share[i],was3$trial6.share[i],was3$trial7.share[i],was3$trial8.share[i],was3$trial9.share[i],was3$trial10.share[i],was3$trial11.share[i],was3$trial12.share[i],was3$trial13.share[i],was3$trial14.share[i],was3$trial15.share[i],was3$trial16.share[i],was3$trial17.share[i],was3$trial18.share[i],was3$trial19.share[i],was3$trial20.share[i],was3$trial21.share[i],was3$trial22.share[i],was3$trial23.share[i],was3$trial24.share[i],was3$trial25.share[i],was3$trial26.share[i],was3$trial27.share[i],was3$trial28.share[i],was3$trial29.share[i],was3$trial30.share[i],was3$trial31.share[i],was3$trial32.share[i],was3$trial33.share[i],was3$trial34.share[i],was3$trial35.share[i],was3$trial36.share[i],was3$trial37.share[i],was3$trial38.share[i],was3$trial39.share[i],was3$trial40.share[i],was3$trial41.share[i],was3$trial42.share[i],was3$trial43.share[i])

num1<-c(was3$trial1.1[i],was3$trial2.1[i],was3$trial3.1[i],was3$trial4.1[i],was3$trial5.1[i],was3$trial6.1[i],was3$trial7.1[i],was3$trial8.1[i],was3$trial9.1[i],was3$trial10.1[i],was3$trial11.1[i],was3$trial12.1[i],was3$trial13.1[i],was3$trial14.1[i],was3$trial15.1[i],was3$trial16.1[i],was3$trial17.1[i],was3$trial18.1[i],was3$trial19.1[i],was3$trial20.1[i],was3$trial21.1[i],was3$trial22.1[i],was3$trial23.1[i],was3$trial24.1[i],was3$trial25.1[i],was3$trial26.1[i],was3$trial27.1[i],was3$trial28.1[i],was3$trial29.1[i],was3$trial30.1[i],was3$trial31.1[i],was3$trial32.1[i],was3$trial33.1[i],was3$trial34.1[i],was3$trial35.1[i],was3$trial36.1[i],was3$trial37.1[i],was3$trial38.1[i],was3$trial39.1[i],was3$trial40.1[i],was3$trial41.1[i],was3$trial42.1[i],was3$trial43.1[i])

num2<-c(was3$trial1.2[i],was3$trial2.2[i],was3$trial3.2[i],was3$trial4.2[i],was3$trial5.2[i],was3$trial6.2[i],was3$trial7.2[i],was3$trial8.2[i],was3$trial9.2[i],was3$trial10.2[i],was3$trial11.2[i],was3$trial12.2[i],was3$trial13.2[i],was3$trial14.2[i],was3$trial15.2[i],was3$trial16.2[i],was3$trial17.2[i],was3$trial18.2[i],was3$trial19.2[i],was3$trial20.2[i],was3$trial21.2[i],was3$trial22.2[i],was3$trial23.2[i],was3$trial24.2[i],was3$trial25.2[i],was3$trial26.2[i],was3$trial27.2[i],was3$trial28.2[i],was3$trial29.2[i],was3$trial30.2[i],was3$trial31.2[i],was3$trial32.2[i],was3$trial33.2[i],was3$trial34.2[i],was3$trial35.2[i],was3$trial36.2[i],was3$trial37.2[i],was3$trial38.2[i],was3$trial39.2[i],was3$trial40.2[i],was3$trial41.2[i],was3$trial42.2[i],was3$trial43.2[i])

num3<-c(was3$trial1.3[i],was3$trial2.3[i],was3$trial3.3[i],was3$trial4.3[i],was3$trial5.3[i],was3$trial6.3[i],was3$trial7.3[i],was3$trial8.3[i],was3$trial9.3[i],was3$trial10.3[i],was3$trial11.3[i],was3$trial12.3[i],was3$trial13.3[i],was3$trial14.3[i],was3$trial15.3[i],was3$trial16.3[i],was3$trial17.3[i],was3$trial18.3[i],was3$trial19.3[i],was3$trial20.3[i],was3$trial21.3[i],was3$trial22.3[i],was3$trial23.3[i],was3$trial24.3[i],was3$trial25.3[i],was3$trial26.3[i],was3$trial27.3[i],was3$trial28.3[i],was3$trial29.3[i],was3$trial30.3[i],was3$trial31.3[i],was3$trial32.3[i],was3$trial33.3[i],was3$trial34.3[i],was3$trial35.3[i],was3$trial36.3[i],was3$trial37.3[i],was3$trial38.3[i],was3$trial39.3[i],was3$trial40.3[i],was3$trial41.3[i],was3$trial42.3[i],was3$trial43.3[i])

p.fit<-c(was3$trial1.p.fit[i],was3$trial2.p.fit[i],was3$trial3.p.fit[i],was3$trial4.p.fit[i],was3$trial5.p.fit[i],was3$trial6.p.fit[i],was3$trial7.p.fit[i],was3$trial8.p.fit[i],was3$trial9.p.fit[i],was3$trial10.p.fit[i],was3$trial11.p.fit[i],was3$trial12.p.fit[i],was3$trial13.p.fit[i],was3$trial14.p.fit[i],was3$trial15.p.fit[i],was3$trial16.p.fit[i],was3$trial17.p.fit[i],was3$trial18.p.fit[i],was3$trial19.p.fit[i],was3$trial20.p.fit[i],was3$trial21.p.fit[i],was3$trial22.p.fit[i],was3$trial23.p.fit[i],was3$trial24.p.fit[i],was3$trial25.p.fit[i],was3$trial26.p.fit[i],was3$trial27.p.fit[i],was3$trial28.p.fit[i],was3$trial29.p.fit[i],was3$trial30.p.fit[i],was3$trial31.p.fit[i],was3$trial32.p.fit[i],was3$trial33.p.fit[i],was3$trial34.p.fit[i],was3$trial35.p.fit[i],was3$trial36.p.fit[i],was3$trial37.p.fit[i],was3$trial38.p.fit[i],was3$trial39.p.fit[i],was3$trial40.p.fit[i],was3$trial41.p.fit[i],was3$trial42.p.fit[i],was3$trial43.p.fit[i])

false.final<-c(was3$trial1.false.final[i],was3$trial2.false.final[i],was3$trial3.false.final[i],was3$trial4.false.final[i],was3$trial5.false.final[i],was3$trial6.false.final[i],was3$trial7.false.final[i],was3$trial8.false.final[i],was3$trial9.false.final[i],was3$trial10.false.final[i],was3$trial11.false.final[i],was3$trial12.false.final[i],was3$trial13.false.final[i],was3$trial14.false.final[i],was3$trial15.false.final[i],was3$trial16.false.final[i],was3$trial17.false.final[i],was3$trial18.false.final[i],was3$trial19.false.final[i],was3$trial20.false.final[i],was3$trial21.false.final[i],was3$trial22.false.final[i],was3$trial23.false.final[i],was3$trial24.false.final[i],was3$trial25.false.final[i],was3$trial26.false.final[i],was3$trial27.false.final[i],was3$trial28.false.final[i],was3$trial29.false.final[i],was3$trial30.false.final[i],was3$trial31.false.final[i],was3$trial32.false.final[i],was3$trial33.false.final[i],was3$trial34.false.final[i],was3$trial35.false.final[i],was3$trial36.false.final[i],was3$trial37.false.final[i],was3$trial38.false.final[i],was3$trial39.false.final[i],was3$trial40.false.final[i],was3$trial41.false.final[i],was3$trial42.false.final[i],was3$trial43.false.final[i])

share.final<-c(was3$trial1.share.final[i],was3$trial2.share.final[i],was3$trial3.share.final[i],was3$trial4.share.final[i],was3$trial5.share.final[i],was3$trial6.share.final[i],was3$trial7.share.final[i],was3$trial8.share.final[i],was3$trial9.share.final[i],was3$trial10.share.final[i],was3$trial11.share.final[i],was3$trial12.share.final[i],was3$trial13.share.final[i],was3$trial14.share.final[i],was3$trial15.share.final[i],was3$trial16.share.final[i],was3$trial17.share.final[i],was3$trial18.share.final[i],was3$trial19.share.final[i],was3$trial20.share.final[i],was3$trial21.share.final[i],was3$trial22.share.final[i],was3$trial23.share.final[i],was3$trial24.share.final[i],was3$trial25.share.final[i],was3$trial26.share.final[i],was3$trial27.share.final[i],was3$trial28.share.final[i],was3$trial29.share.final[i],was3$trial30.share.final[i],was3$trial31.share.final[i],was3$trial32.share.final[i],was3$trial33.share.final[i],was3$trial34.share.final[i],was3$trial35.share.final[i],was3$trial36.share.final[i],was3$trial37.share.final[i],was3$trial38.share.final[i],was3$trial39.share.final[i],was3$trial40.share.final[i],was3$trial41.share.final[i],was3$trial42.share.final[i],was3$trial43.share.final[i])

false.final<-false.final%%2
share.final<-share.final%%2

a<-data.frame(name,trial,open,feedback,error,share,num1,num2,num3,p.fit,false.final,share.final,incentive,score,ascending,consecutive,even,lower,upper,final.answer,stringsAsFactors=FALSE)
was3d<-rbind(was3d,a)
}
 
TFTR<-ifelse(was3d$num1<was3d$num2 & was3d$num2<was3d$num3 & was3d$num1%%2==0 & (was3d$num2-was3d$num1)==2 & (was3d$num3-was3d$num2)==2 & was3d$num1>=2 & was3d$num3<=100,1,0)
was3d<-cbind(was3d,TFTR)
actual.error<-ifelse((was3d$TFTR==1 & was3d$feedback==2) | (was3d$TFTR==0 & was3d$feedback==1),1,0)
was3d<-cbind(was3d,actual.error)
##During task error attributions:1=True; 2=False##
##During task sharing: 1=Yes; 2=No##
##Final error attributions:1=False;2=True##
##Final Sharing:1=Share; 2=dont share####
was3d$error.should<-ifelse(is.na(was3d$feedback)==TRUE,NA,0)
was3d$error.should[was3d$feedback==2 & was3d$p.fit>80]<-1
was3d$error.should[was3d$feedback==1 & was3d$p.fit<20]<-1
was3d$error.should[was3d$feedback==2 & was3d$p.fit==80]<-NA
was3d$error.should[was3d$feedback==1 & was3d$p.fit==20]<-NA

was3d$cons.tp<-ifelse(was3d$error.should==1 & was3d$error==1,1,0)
was3d$cons.tn<-ifelse(was3d$error.should==0 & was3d$error==0,1,0)
was3d$cons.fp<-ifelse(was3d$error.should==0 & was3d$error==1,1,0)
was3d$cons.fn<-ifelse(was3d$error.should==1 & was3d$error==0,1,0)

was3d$subjectid<-as.numeric(was3d$name)
was3d$falsification<-was3d$feedback-1
was3d$incentivef<-as.factor(was3d$incentive)
was3d$incentive<-as.factor(was3d$incentive)
levels(was3d$incentive)<-c(0,1)
was3d$error<-was3d$error-1
was3d$share<-was3d$share%%2

score.comp<-c()
for(i in levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0])))){
  score.comp[i]<-was3d$score[was3d$subjectid==i][1]}
score.perv<-c()
for(i in levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1])))){
  score.perv[i]<-was3d$score[was3d$subjectid==i][1]}

was3d$trial.ascending<-ifelse(was3d$num1<was3d$num2 & was3d$num2<was3d$num3,1,0)
was3d$trial.consecutive<-ifelse(abs(was3d$num1-was3d$num2)==2 & abs(was3d$num2-was3d$num3)==2,1,0)
was3d$trial.even<-ifelse(was3d$num1%%2==0 & was3d$num2%%2==0 & was3d$num3%%2==0,1,0)
was3d$trial.lower<-ifelse(was3d$num1>=2 & was3d$num2>=2 & was3d$num3>=2,1,0)
was3d$trial.upper<-ifelse(was3d$num3<=100 & was3d$num2<=100 & was3d$num1<=100,1,0)
was3d$num.inconsistent<-ifelse(was3d$ascending==was3d$trial.ascending & was3d$consecutive==was3d$trial.consecutive & was3d$even==was3d$trial.even,0,1)
was3d$final.consistent<-ifelse(was3d$num.inconsistent==was3d$falsification,1,0)

final.consistent<-glmer(share.final~final.consistent+(1|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
final.consistent.i<-glmer(share.final~final.consistent+(1|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
final.consistent.t<-glmer(share.final~final.consistent*incentive+(1|subjectid),data=was3d,family=binomial(link="logit"))

unique.id<-was3.t[,c("V1075","V1")]
qqq<-levels(unique.id$V1)
for(i in 1:length(qqq)){
was3d$unique.id[was3d$name==qqq[i]]<-as.character(unique.id$V1075[unique.id$V1==qqq[i]])
}

                  
##Control: Nested Boostrap##
chip<-c()
phip<-c()
phi.p<-c()
chip.final<-c()
phip.final<-c()
phi.p.final<-c()
glmeraa<-c()
glmerff<-c()
glmeraa.final<-c()
glmerff.final<-c()
glmershnerr<-c()
glmersherr<-c()
glmershnerr.final<-c()
glmersherr.final<-c()
glmersha<-c()
glmershf<-c()
tfals<-c()
tfals.final<-c()
tsh<-c()
tsherr<-c()
tsherr.final<-c()
icc.shatt.final<-c()
icc.shatt<-c()
icc.shfee<-c()
glmershatt.final.chi<-c()
glmershatt.final.chip<-c()
glmershfee.chi<-c()
glmershfee.chip<-c()
glmershatt.chi<-c()
glmershatt.chip<-c()
qf<-was3d
##For each observation in the dataset make a zero##
qf$new.id<-c(rep(0,length(qf$subjectid)))
for(i in 1:n3){
##obtain the id numbers of subjects we want##
a<-as.numeric(levels(as.factor(as.character(qf$subjectid[qf$incentive==0]))))
##Sort a sample from these subjects##
a<-sort(sample(a,size=length(a),replace=TRUE))
##Make some new IDs for the bootstrap sample##
new.id<-seq(length(a))
##Make a data frame holding the old and new ID numbers##
a<-cbind(a,new.id)
a<-data.frame(a)
q1<-data.frame()
####
##For each ID number##
for(j in 1:length(a[,2])){
##The participant with subjectID equal to the jth ID number gets a new id numer equal to j##
  qf$new.id[qf$subjectid==a$a[j]]<-j
  ##Add this new participant to the bootstrapped sample##
q1<-rbind(q1,qf[qf$subjectid==a$a[j],])
} 
glmerfals<-glmer(error~falsification+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmeraa[i]<-invlogit(fixef(glmerfals)[1])
glmerff[i]<-invlogit(fixef(glmerfals)[1]+fixef(glmerfals)[2])
tfals[i]<-fixef(glmerfals)[2]/sqrt(diag(vcov(glmerfals))[2])

glmerfals.final<-glmer(false.final~falsification+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmeraa.final[i]<-invlogit(fixef(glmerfals.final)[1])
glmerff.final[i]<-invlogit(fixef(glmerfals.final)[1]+fixef(glmerfals.final)[2])
tfals.final[i]<-fixef(glmerfals.final)[2]/sqrt(diag(vcov(glmerfals.final))[2])

glmerphi<-glmer(actual.error~error+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip[i]<-nova$Chisq[2]
phip[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1[q1$incentive==0,]$error)))
phi.p[i]<-nova[2,7]

glmerphi<-glmer(actual.error~false.final+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.final[i]<-nova$Chisq[2]
phip.final[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1[q1$incentive==0,]$false.final)))
phi.p.final[i]<-nova[2,7]

glmershfee<-glmer(share~falsification+(falsification|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershfee.int<-glmer(share~falsification+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmersha[i]<-invlogit(fixef(glmershfee.int)[1])
glmershf[i]<-invlogit(fixef(glmershfee.int)[1]+fixef(glmershfee.int)[2])
glmershfee.anova<-anova(glmershfee,glmershfee.int)
glmershfee.chi[i]<-glmershfee.anova$Chisq[2]
glmershfee.chip[i]<-glmershfee.anova[2,7]
lmershfee<-lmer(share~falsification+(falsification|new.id),data=q1[q1$incentive==0,])
icc.shfee[i]<-(as.numeric(summary(lmershfee)@REmat[,4][2]))/(as.numeric(summary(lmershfee)@REmat[,4][1])+as.numeric(summary(lmershfee)@REmat[,4][2])+as.numeric(summary(lmershfee)@REmat[,4][3]))
tsh[i]<-abs(fixef(glmershfee)[2]/sqrt(diag(vcov(glmershfee))[2]))

glmershatt<-glmer(share~error+(error|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershatt.int<-glmer(share~error+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershnerr[i]<-invlogit(fixef(glmershatt.int)[1])
glmersherr[i]<-invlogit(fixef(glmershatt.int)[1]+fixef(glmershatt.int)[2])
glmershatt.anova<-anova(glmershatt,glmershatt.int)
glmershatt.chi[i]<-glmershatt.anova$Chisq[2]
glmershatt.chip[i]<-glmershatt.anova[2,7]
lmershatt<-lmer(share~error+(error|new.id),data=q1[q1$incentive==0,])
icc.shatt[i]<-(as.numeric(summary(lmershatt)@REmat[,4][2]))/(as.numeric(summary(lmershatt)@REmat[,4][1])+as.numeric(summary(lmershatt)@REmat[,4][2])+as.numeric(summary(lmershatt)@REmat[,4][3]))
tsherr[i]<-abs(fixef(glmershatt)[2]/sqrt(diag(vcov(glmershatt))[2]))

glmershatt.final<-glmer(share.final~false.final+(false.final|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershatt.final.int<-glmer(share.final~false.final+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershnerr.final[i]<-invlogit(fixef(glmershatt.final.int)[1])
glmersherr.final[i]<-invlogit(fixef(glmershatt.final.int)[1]+fixef(glmershatt.final.int)[2])
glmershatt.final.anova<-anova(glmershatt.final,glmershatt.final.int)
glmershatt.final.chi[i]<-glmershatt.final.anova$Chisq[2]
glmershatt.final.chip[i]<-glmershatt.final.anova[2,7]
lmershatt.final<-lmer(share.final~false.final+(false.final|new.id),data=q1[q1$incentive==0,])
icc.shatt.final[i]<-(as.numeric(summary(lmershatt.final)@REmat[,4][2]))/(as.numeric(summary(lmershatt.final)@REmat[,4][1])+as.numeric(summary(lmershatt.final)@REmat[,4][2])+as.numeric(summary(lmershatt.final)@REmat[,4][3]))
tsherr.final[i]<-abs(fixef(glmershatt.final)[2]/sqrt(diag(vcov(glmershatt.final))[2]))
}
glmeraa.se<-sd(glmeraa)
glmerff.se<-sd(glmerff)
glmeraa.se.final<-sd(glmeraa.final)
glmerff.se.final<-sd(glmerff.final)
glmershf.se<-sd(glmershf)
glmersha.se<-sd(glmersha)
glmershnerr.se<-sd(glmershnerr)
glmersherr.se<-sd(glmersherr)
glmershnerr.se.final<-sd(glmershnerr.final)
glmersherr.se.final<-sd(glmersherr.final)
####
####Incentive Nested Boostrap##
chip.i<-c()
phip.i<-c()
phi.p.i<-c()
chip.i.final<-c()
phip.i.final<-c()
phi.p.i.final<-c()
glmeraa.i<-c()
glmerff.i<-c()
glmeraa.final.i<-c()
glmerff.final.i<-c()
glmershnerr.i<-c()
glmersherr.i<-c()
glmershnerr.final.i<-c()
glmersherr.final.i<-c()
glmshnerr.final.i<-c()
glmsherr.final.i<-c()
glmersha.i<-c()
glmershf.i<-c()
tfals.i<-c()
tfals.final.i<-c()
tsh.i<-c()
tsherr.i<-c()
tsherr.final.i<-c()
icc.shatt.i<-c()
icc.shfee.i<-c()
icc.shatt.final.i<-c()
glmershatt.final.i.chi<-c()
glmershatt.final.i.chip<-c()
glmershatt.i.chi<-c()
glmershatt.i.chip<-c()
glmershfee.i.chi<-c()
glmershfee.i.chip<-c()
qf<-was3d
##For each observation in the dataset make a zero##
qf$new.id<-c(rep(0,length(qf$subjectid)))
for(i in 1:n3){
a<-as.numeric(levels(as.factor(as.character(qf$subjectid[qf$incentive==1]))))
##Sort a sample from these subjects##
a<-sort(sample(a,size=length(a),replace=TRUE))
##Make some new IDs for the bootstrap sample##
new.id<-seq(length(a))
##Make a data frame holding the old and new ID numbers##
a<-cbind(a,new.id)
a<-data.frame(a)
q1<-data.frame()
####
##For each ID number##
for(j in 1:length(a[,2])){
##The participant with subjectID equal to the jth ID number gets a new id numer equal to j##
  qf$new.id[qf$subjectid==a$a[j]]<-j
  ##Add this new participant to the bootstrapped sample##
q1<-rbind(q1,qf[qf$subjectid==a$a[j],])
} 

glmerfals.i<-glmer(error~falsification+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmeraa.i[i]<-invlogit(fixef(glmerfals.i)[1])
glmerff.i[i]<-invlogit(fixef(glmerfals.i)[1]+fixef(glmerfals.i)[2])
tfals.i[i]<-fixef(glmerfals.i)[2]/sqrt(diag(vcov(glmerfals.i))[2])

glmerfals.final.i<-glmer(false.final~falsification+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmeraa.final.i[i]<-invlogit(fixef(glmerfals.final.i)[1])
glmerff.final.i[i]<-invlogit(fixef(glmerfals.final.i)[1]+fixef(glmerfals.final.i)[2])
tfals.final.i[i]<-fixef(glmerfals.final.i)[2]/sqrt(diag(vcov(glmerfals.final.i))[2])

glmerphi<-glmer(actual.error~error+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.i[i]<-nova$Chisq[2]
phip.i[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1[q1$incentive==1,]$error)))
phi.p.i[i]<-nova[2,7]

glmerphi<-glmer(actual.error~false.final+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.i.final[i]<-nova$Chisq[2]
phip.i.final[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1[q1$incentive==1,]$false.final)))
phi.p.i.final[i]<-nova[2,7]

glmershfee.i<-glmer(share~falsification+(falsification|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershfee.i.int<-glmer(share~falsification+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmersha.i[i]<-invlogit(fixef(glmershfee.i.int)[1])
glmershf.i[i]<-invlogit(fixef(glmershfee.i.int)[1]+fixef(glmershfee.i.int)[2])
glmershfee.i.anova<-anova(glmershfee.i,glmershfee.i.int)
glmershfee.i.chi[i]<-glmershfee.i.anova$Chisq[2]
glmershfee.i.chip[i]<-glmershfee.i.anova[2,7]
lmershfee.i<-lmer(share~falsification+(falsification|new.id),data=q1[q1$incentive==1,])
icc.shfee.i[i]<-(as.numeric(summary(lmershfee.i)@REmat[,4][2]))/(as.numeric(summary(lmershfee.i)@REmat[,4][1])+as.numeric(summary(lmershfee.i)@REmat[,4][2])+as.numeric(summary(lmershfee.i)@REmat[,4][3]))
tsh.i[i]<-abs(fixef(glmershfee.i)[2]/sqrt(diag(vcov(glmershfee.i))[2]))

glmershatt.i<-glmer(share~error+(error|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershatt.i.int<-glmer(share~error+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershnerr.i[i]<-invlogit(fixef(glmershatt.i.int)[1])
glmersherr.i[i]<-invlogit(fixef(glmershatt.i.int)[1]+fixef(glmershatt.i.int)[2])
glmershatt.i.anova<-anova(glmershatt.i,glmershatt.i.int)
glmershatt.i.chi[i]<-glmershatt.i.anova$Chisq[2]
glmershatt.i.chip[i]<-glmershatt.i.anova[2,7]
lmershatt.i<-lmer(share~error+(error|new.id),data=q1[q1$incentive==1,])
icc.shatt.i[i]<-(as.numeric(summary(lmershatt.i)@REmat[,4][2]))/(as.numeric(summary(lmershatt.i)@REmat[,4][1])+as.numeric(summary(lmershatt.i)@REmat[,4][2])+as.numeric(summary(lmershatt.i)@REmat[,4][3]))
tsherr.i[i]<-abs(fixef(glmershatt.i)[2]/sqrt(diag(vcov(glmershatt.i))[2]))

glmershatt.final.i<-glmer(share.final~false.final+(false.final|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershatt.final.i.int<-glmer(share.final~false.final+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershatt.final.i.anova<-anova(glmershatt.final.i,glmershatt.final.i.int)
glmershatt.final.i.chi[i]<-glmershatt.final.i.anova$Chisq[2]
glmershatt.final.i.chip[i]<-glmershatt.final.i.anova[2,7]
glmershnerr.final.i[i]<-invlogit(fixef(glmershatt.final.i.int)[1])
glmersherr.final.i[i]<-invlogit(fixef(glmershatt.final.i.int)[1]+fixef(glmershatt.final.i.int)[2])

tsherr.final.i[i]<-abs(fixef(glmershatt.final.i)[2]/sqrt(diag(vcov(glmershatt.final.i))[2]))
glmshatt.final.i<-glm(share.final~false.final,data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmshnerr.final.i[i]<-invlogit(coef(glmshatt.final.i)[1])
glmsherr.final.i[i]<-invlogit(coef(glmshatt.final.i)[1]+coef(glmshatt.final.i)[2])

lmershatt.final.i<-lmer(share.final~false.final+(false.final|new.id),data=q1[q1$incentive==1,])
icc.shatt.final.i[i]<-(as.numeric(summary(lmershatt.final.i)@REmat[,4][2]))/(as.numeric(summary(lmershatt.final.i)@REmat[,4][1])+as.numeric(summary(lmershatt.final.i)@REmat[,4][2])+as.numeric(summary(lmershatt.final.i)@REmat[,4][3]))
}

glmeraa.se.i<-sd(glmeraa.i)
glmerff.se.i<-sd(glmerff.i)
glmeraa.se.final.i<-sd(glmeraa.final.i)
glmerff.se.final.i<-sd(glmerff.final.i)
glmershf.se.i<-sd(glmershf.i)
glmersha.se.i<-sd(glmersha.i)
glmershnerr.se.i<-sd(glmershnerr.i)
glmersherr.se.i<-sd(glmersherr.i)
glmershnerr.se.final.i<-sd(glmershnerr.final.i)
glmersherr.se.final.i<-sd(glmersherr.final.i)
glmsherr.se.final.i<-sd(glmsherr.final.i)
                       
####
##Control: Hierarchical linear model for correlation between prior (P(TFTR)) and error attribution##
glmer.ov<-glmer(error.should~error+(1|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
glmer.ov.null<-glmer(error.should~(1|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
nova.ov<-anova(glmer.ov.null,glmer.ov)
chi.ov<-nova.ov$Chisq[2]
phi.ov<-sqrt(chi.ov/length(na.omit(was3d$actual.error[was3d$incentive==0])))
####
##As a check: phi at the participant level for people who it could be calculated###
cons.chi<-c()
cons.denom<-c()
cons.phi<-c()
for(i in levels(as.factor(as.character(was3d$subjectid)))){
cons.chi[i]<-sum(na.omit(was3d$cons.tp[was3d$subjectid==i]))*sum(na.omit(was3d$cons.tn[was3d$subjectid==i]))-sum(na.omit(was3d$cons.fp[was3d$subjectid==i]))*sum(na.omit(was3d$cons.fn[was3d$subjectid==i]))
cons.denom[i]<-sqrt((sum(na.omit(was3d$cons.tp[was3d$subjectid==i]))+sum(na.omit(was3d$cons.fp[was3d$subjectid==i])))*(sum(na.omit(was3d$cons.fn[was3d$subjectid==i]))+sum(na.omit(was3d$cons.tn[was3d$subjectid==i])))*(sum(na.omit(was3d$cons.fp[was3d$subjectid==i]))+sum(na.omit(was3d$cons.tn[was3d$subjectid==i])))*(sum(na.omit(was3d$cons.tp[was3d$subjectid==i]))+sum(na.omit(was3d$cons.fn[was3d$subjectid==i]))))
cons.phi[i]<-cons.chi[i]/cons.denom[i]
}
####
##Incentive: Hierarchical linear model for correlation between prior (P(TFTR)) and error attribution##

glmer.ov.i<-glmer(error.should~error+(1|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
glmer.ov.null.i<-glmer(error.should~(1|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
nova.ov.i<-anova(glmer.ov.null.i,glmer.ov.i)
chi.ov.i<-nova.ov.i$Chisq[2]
phi.ov.i<-sqrt(chi.ov.i/length(na.omit(was3d$actual.error[was3d$incentive==1])))

####
##Total Bayes Trials##
bayes.control<-sum(was3d$error[was3d$falsification==1 & was3d$p.fit>0.8 & was3d$incentive==0])+sum(was3d$error[was3d$falsification==0 & was3d$p.fit<0.2 & was3d$incentive==0])+length(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==0])-sum(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==0])+length(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==0])-sum(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==0])

total.control<-length(was3d$error[was3d$falsification==1 & was3d$p.fit>0.8 & was3d$incentive==0])+length(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==0])+length(was3d$error[was3d$falsification==0 & was3d$p.fit<0.2 & was3d$incentive==0])+length(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==0])

bayes.incentive<-sum(was3d$error[was3d$falsification==1 & was3d$p.fit>0.8 & was3d$incentive==1])+sum(was3d$error[was3d$falsification==0 & was3d$p.fit<0.2 & was3d$incentive==1])+length(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==1])-sum(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==1])+length(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==1])-sum(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==1])

total.incentive<-length(was3d$error[was3d$falsification==1 & was3d$p.fit>0.8 & was3d$incentive==1])+length(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==1])+length(was3d$error[was3d$falsification==0 & was3d$p.fit<0.2 & was3d$incentive==1])+length(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==1])
###
##Trials##
was3d$complete<-ifelse(is.na(was3d$feedback)==FALSE,1,0)
trials<-c()
incentive<-c()
for(i in 1:length(levels(as.factor(was3d$subjectid)))){
trials[i]<-sum(was3d$complete[was3d$subjectid==i])
incentive[i]<-was3d$incentive[was3d$subjectid==i][1]
}
trialsd<-data.frame(cbind(trials,incentive))
trial.test<-t.test(trialsd$trials~trialsd$incentive)
@ 

\subsubsection{Participants}  
One hundred Amazon Mturk volunteers completed the task for \$5. There were 46 women, with average age of \Sexpr{prettyNum(mean(was3$age,na.rm=TRUE))} years (range: \Sexpr{min(was3$age[was3$age!=2],na.rm=TRUE)}--\Sexpr{max(was3$age,na.rm=TRUE)}).

\subsubsection{Design}
The design was a 2 level (perverse or compatible incentive) between-subjects design.

\subsubsection{Materials}
The procedure and materials were the same as in Experiment Two except for the following modifications.  First, participants completed three `practice trials' to help them understand the task.  They were then told the following: 

\begin{quote}
 ``We are also interested in how people share information.  The information comes in trials.  A trial is a page where you proposed a triple and received feedback.  The practice trials you conducted are shown below.  For each trial you share, another person will get the triple you proposed and the feedback you received.  The person will also receive the Final Answer you propose at the end of the task, regardless of the trials you share.''
\end{quote}

\begin{flushleft}
Participants were then told about possible bonus money:
\end{flushleft}

\begin{quote}
``Both you and the person you share trials with can earn up to a \$5 bonus in addition to the \$5 you receive for participating in the experiment.'' 
\end{quote}

\begin{flushleft}
The perverse incentive condition was followed with this text:
\end{flushleft}
\begin{quote}
``How you earn bonus money:
\begin{itemize}
  \item If the other person thinks your Final Answer matches the Actual Rule exactly, then you get \$5.
  \item If the other person thinks your Final Answer does not match the Actual Rule at all, then you get \$0.
  \item If the other person thinks your Final Answer somewhat matches the Actual Rule, then you get somewhere between \$0 and \$5.''
\end{itemize}
\end{quote}
\begin{quote}
``How the person you are sharing trials with earns bonus money: \newline
The person you are sharing trials with can also earn money.
\begin{itemize}
  \item This person gets the most money (\$5) by correctly judging how well your Final Answer matches the Actual Rule.
  \item If this person thinks your Final Answer matches the Actual Rule, but it does not, the other person gets less money. 
  \item If this person thinks your Final Answer does not match the Actual Rule, but it is does, the other person gets less money.''
    \end{itemize}
\end{quote}

\begin{flushleft}
Those in the compatible incentive condition were told:
\end{flushleft}

\begin{quote}
  \begin{itemize}
  \item ``If the other person's guess matches the Actual Rule exactly, then you both get \$5.
  \item If the other person's guess does not match the Actual Rule at all, then you both get \$0.
  \item If the other person's guess somewhat matches the Actual Rule, then you both get somewhere between \$0 and \$5.''
  \end{itemize}
  \end{quote}

\begin{flushleft}
Finally, participants were told the penalty for making incorrect attributions:
\end{flushleft}
\begin{quote}
``Penalty for wrong answers

Any bonus you get will be reduced if your false feedback and probability judgments are wrong. Thus, to earn the most money you should make your false feedback and probability judgments as accurate as possible.''
\end{quote}

\subsection{Results}

\subsubsection{Incentives and Performance}

As in Experiment Two, participants in the compatible and perverse incentive conditions completed a median of about 8 trials (\Sexpr{prettyNum(median(trialsd$trials[trialsd$incentive==1]))} and \Sexpr{prettyNum(median(trialsd$trials[trialsd$incentive==2]))}, respectively), $t(97)=$ \Sexpr{prettyNum(trial.test$statistic)}, $p=$ \Sexpr{prettyNum(ptrunc(trial.test$p.value))}, $d=$ \Sexpr{prettyNum(trial.test$statistic/sqrt(99))}.%$  Using the same scoring method as before, those in the compatible incentive condition scored about the same ($M=$ \Sexpr{prettyNum(mean(score.comp,na.rm=TRUE))}, $SD=$ \Sexpr{prettyNum(sd(score.comp,na.rm=TRUE))}) as those in the perverse incentive condition ($M=$ \Sexpr{prettyNum(mean(score.perv,na.rm=TRUE))}, $SD=$ \Sexpr{prettyNum(sd(score.perv,na.rm=TRUE))}), $t(98)=$ \Sexpr{prettyNum(t.test(score.comp,score.perv)$statistic)}, $p=$ \Sexpr{prettyNum(ptrunc(t.test(score.comp,score.perv)$p.value))}. %$  

\subsubsection{Attributions to Error}

Both during (\Sexpr{prettyNum(100*mean(glmerff))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa))}\%) and at the end of the task (\Sexpr{prettyNum(100*mean(glmerff.final))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa.final))}\%), those in the compatible incentive condition were more likely to see feedback as in error when it was disconfirming than when it was affirming, ($t(510)=$ \Sexpr{prettyNum(mean(tfals))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals),510)*2))}, $d=$ \Sexpr{prettyNum(mean(tfals)/sqrt(513))}; $t(525)=$ \Sexpr{prettyNum(mean(tfals.final))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals.final),525)*2))}, $d=$ \Sexpr{prettyNum(mean(tfals.final)/sqrt(528))}, respectively).  Similarly, both during (\Sexpr{prettyNum(100*mean(glmerff.i))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa.i))}\%) and at the end of the task (\Sexpr{prettyNum(100*mean(glmerff.final.i))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa.final.i))}\%), those in the perverse incentive condition were significantly more likely to see feedback as in error when it was disconfirming than when it was affirming ($t(537)=$ \Sexpr{prettyNum(mean(tfals.i))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals.i),537)*2))}, \emph{d} = \Sexpr{prettyNum(mean(tfals.i)/sqrt(540))}; $t(504)=$ \Sexpr{prettyNum(mean(tfals.final.i))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals.final.i),504)*2))}, $d=$ \Sexpr{prettyNum(mean(tfals.final.i)/sqrt(507))}, respectively). 

\subsubsection{Bayesian Consistency}

For both incentive groups, adding the penalty for incorrect error attributions and probability judgments greatly improved accuracy and consistency, as compared to Experiments One and Two.  For the compatible condition, the overall correlation between their attributions to error and the consistency criterion was $\phi=$ \Sexpr{prettyNum(phi.ov)}, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi.ov)}, $p<$ \Sexpr{prettyNum(ptrunc(dchisq(chi.ov,1)*2))}.  Participants in the perverse incentive condition exhibited even greater consistency, $\phi=$ \Sexpr{prettyNum(phi.ov.i)}, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi.ov.i)}, $p<$ \Sexpr{prettyNum(ptrunc(dchisq(chi.ov.i,1)*2))}.

%\footnote{For affirming feedback in the compatible condition, they correctly attributed \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$falsification==0 & was3d$p.fit<0.2 & was3d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was3d$error[was3d$falsification==0 & was3d$p.fit<0.2 & was3d$incentive==0])))} trials to error, and incorrectly attributed \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==0])))} trials to error, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi2a)}, $p<$ \Sexpr{prettyNum(ptrunc(dchisq(chi2a,1)*2))}, $\phi=$ \Sexpr{prettyNum(phia)}.  For disconfirming feedback they correctly attributed \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$falsification==1 & was3d$p.fit>0.8 & was3d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was3d$error[was3d$falsification==1 & was3d$p.fit>0.8 & was3d$incentive==0])))} trials to error, and incorrectly attributed \Sexpr{prettyNum(sum(na.omit(was3$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==0])))} trials to error, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi2f)}, $p<0.05$, $\phi=$ \Sexpr{prettyNum(phif)}.  For affirming feedback in the perverse condition, they correctly attributed \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$falsification==0 & was3d$p.fit<0.2 & was3d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$error[was3d$falsification==0 & was3d$p.fit<0.2 & was3d$incentive==1])))} trials to error, and incorrectly attributed \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$error[was3d$falsification==0 & was3d$p.fit>0.2 & was3d$incentive==1])))} trials to error, $\chi^{2}(1)=$ \Sexpr{prettyNum(affchip.i)}, $p=$ \Sexpr{prettyNum(ptrunc(affphi.p.i))}, $\phi=$ \Sexpr{prettyNum(affphip.i)}.  For disconfirming feedback they attributed \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$falsification==1 & was3d$p.fit>0.8 & was3d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$error[was3d$falsification==1 & was3d$p.fit>0.8 & was3d$incentive==1])))} trials to error correctly, and incorrectly attributed \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$error[was3d$falsification==1 & was3d$p.fit<0.8 & was3d$incentive==1])))} trials to error, $\chi^{2}(1) = \Sexpr{prettyNum(discchip.i)}$, $p<0.05$, $\phi=$ \Sexpr{prettyNum(discphip.i)}.}  

\subsubsection{Accuracy}
Participants both in the compatible and perverse incentive conditions were able to accurately identify error during the task ($\chi^{2}(1) = \Sexpr{prettyNum(mean(chip))}$, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p)))}, $\phi = \Sexpr{prettyNum(mean(phip))}$; $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(chip.i))}, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p.i)))}, $\phi=$ \Sexpr{prettyNum(mean(phip.i))}, respectively).  Participants in the compatible incentive group correctly identified \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$actual.error==1 & was3d$incentive==0])))} of \Sexpr{prettyNum(sum(na.omit(was3d$actual.error[was3d$incentive==0])))} actual errors and incorrectly identified \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$actual.error==0 & was3d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was3d$feedback[was3d$actual.error==0 & was3d$incentive==0])))} non-errors as error.  For the perverse incentive condition, participants correctly identified \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$actual.error==1 & was3d$incentive==1])))} of \Sexpr{prettyNum(sum(na.omit(was3d$actual.error[was3d$incentive==1])))} actual errors and incorrectly identified \Sexpr{prettyNum(sum(na.omit(was3d$error[was3d$actual.error==0 & was3d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$feedback[was3d$actual.error==0 & was3d$incentive==1])))} non-errors as error.  This accuracy also slightly improved in judgments made at the end of the task for both the compatible and perverse incentive conditions ($\chi^{2}(1) = \Sexpr{prettyNum(mean(chip.final))}$, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p.final)))}, $\phi = \Sexpr{prettyNum(mean(phip.final))}$; $\chi^{2}(1) = \Sexpr{prettyNum(mean(chip.i.final))}$, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p.i.final)))}, $\phi = \Sexpr{prettyNum(mean(phip.i.final))}$, respectively).

\subsubsection{Data Sharing}
Participants in the compatible incentive condition shared \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$falsification==1 & was3d$incentive==0 & was3d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$falsification==1 & was3d$incentive==0])))} trials when the feedback was disconfirming $(\Sexpr{prettyNum(100*mean(glmershf))}\%, SE = \Sexpr{prettyNum(100*glmershf.se)}\%)$ and \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$falsification==0 & was3d$incentive==0 & was3d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$falsification==0 & was3d$incentive==0])))} when it was affirming $(\Sexpr{prettyNum(100*mean(glmersha))}\%, SE = \Sexpr{prettyNum(100*glmersha.se)}\%)$, $t(499)$ = \Sexpr{prettyNum(mean(tsh))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsh),499)*2))}, $\emph{d} = \Sexpr{prettyNum(mean(tsh)/sqrt(502))}$.  Similarly, they shared \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$error==1 & was3d$incentive==0 & was3d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$error==1 & was3d$incentive==0])))} trials when they attributed feedback to error $(\Sexpr{prettyNum(100*mean(glmersherr))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se)}\%)$ and \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$error==0 & was3d$incentive==0 & was3d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$error==0 & was3d$incentive==0])))} when they judged it to be accurate $(\Sexpr{prettyNum(100*mean(glmershnerr))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se)}\%)$, $t(570)$ = \Sexpr{prettyNum(mean(tsherr))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr),570)*2))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr)/sqrt(573))}$.  

At the end of the task, participants shared \Sexpr{prettyNum(length(na.omit(was3d$share.final[was3d$false.final==1 & was3d$incentive==0 & was3d$share.final==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share.final[was3d$false.final==1 & was3d$incentive==0])))} trials that they judged to be an error $(\Sexpr{prettyNum(100*mean(glmersherr.final))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se.final)}\%)$ and \Sexpr{prettyNum(length(na.omit(was3d$share.final[was3d$false.final==0 & was3d$incentive==0 & was3d$share.final==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share.final[was3d$false.final==0 & was3d$incentive==0])))} when they judged it to be accurate $(\Sexpr{prettyNum(100*mean(glmershnerr.final))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se.final)}\%)$, $t(515)$ = \Sexpr{prettyNum(mean(tsherr.final))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.final),515)*2))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr.final)/sqrt(518))}$.  However, there was also significant variation across participants in how much data they shared when they perceived the feedback to be an error, $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.final.chi))}, $p<$ \Sexpr{prettyNum(ptrunc(median(glmershatt.final.chip)))}.  As can be seen in Figure~\ref{fig:was3fig}, most participants in the compatible incentive condition shared all of the trials they attributed to error at the end of the task, while a significant proportion shared none of those trials.  However, there was no such variation for data sharing in response to disconfirming feedback $\chi^{2}(2)=$ \Sexpr{prettyNum(mean(glmershfee.chi))}, $p=$ \Sexpr{prettyNum(ptrunc(median(glmershfee.chip)))}, or error attributions during the task, $\chi^{2}(2)=$ \Sexpr{prettyNum(mean(glmershatt.chi))}, $p=$ \Sexpr{prettyNum(ptrunc(median(glmershatt.chip)))}.  

<<histograms,echo=false,fig=false,results=hide>>=
glmershatt.final<-glmer(share.final~false.final+(false.final|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
a<-sim(glmershatt.final,100)
hist.final<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.final[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershatt<-glmer(share~error+(error|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
a<-sim(glmershatt,100)
hist.err<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.err[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershfee<-glmer(share~falsification+(falsification|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
a<-sim(glmershfee,100)
hist.fee<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.fee[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershatt.final.i<-glmer(share.final~false.final+(false.final|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
a<-sim(glmershatt.final.i,100)
hist.final.i<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.final.i[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershatt.i<-glmer(share~error+(error|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
a<-sim(glmershatt.i,100)
hist.err.i<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.err.i[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershfee.i<-glmer(share~falsification+(falsification|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
a<-sim(glmershfee.i,100)
hist.fee.i<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.fee.i[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

png(file="was3.png",width=1500,height=1000,res=200)
hist.fee.df<-data.frame(hist=hist.fee,Incentive=rep("Compatible",length(hist.fee)),Type=rep("Disc. Feedback",length(hist.fee)))
hist.feei.df<-data.frame(hist=hist.fee.i,Incentive=rep("Perverse",length(hist.fee.i)),Type=rep("Disc. Feedback",length(hist.fee.i)))
hist.err.df<-data.frame(hist=hist.err,Incentive=rep("Compatible",length(hist.err)),Type=rep("Trial-by-Trial Error",length(hist.err)))
hist.erri.df<-data.frame(hist=hist.err.i,Incentive=rep("Perverse",length(hist.err.i)),Type=rep("Trial-by-Trial Error",length(hist.err.i)))
hist.final.df<-data.frame(hist=hist.final,Incentive=rep("Compatible",length(hist.final)),Type=rep("End-of-Task Error",length(hist.final)))
hist.finali.df<-data.frame(hist=hist.final.i,Incentive=rep("Perverse",length(hist.final.i)),Type=rep("End-of-Task Error",length(hist.final.i)))
hist<-rbind(hist.fee.df,hist.feei.df)
hist<-rbind(hist,hist.err.df)
hist<-rbind(hist,hist.erri.df)
hist<-rbind(hist,hist.final.df)
hist<-rbind(hist,hist.finali.df)

p <- ggplot(hist, aes(hist,..count..,color=Incentive,fill=Incentive),opts(panel.grid.major = theme_bw() ,panel.grid.minor = theme_bw(),panel.background = theme_bw(),axis.ticks = theme_blank())) 
p + geom_histogram()+facet_grid(Type~Incentive)+theme_bw()+ylab("Frequency")+xlab("Proportion of Trials Shared")+scale_y_continuous(limits = c(0,20))+scale_color_manual(values = c("darkblue","darkred"))+scale_fill_manual(values = c("white","white"))+opts(legend.position="bottom")
dev.off()

share.should<-glmer(share.final~actual.error+error+(1|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
share.should.i<-glmer(share.final~actual.error+error+(1|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
@ 

\begin{figure*}[h] \pause
    \centering
\scalebox{0.9}{\includegraphics[\textwidth]{was3}}
\caption{Proportion of trials shared by whether the trial was disconfirming (top row), whether participants attributed that trial to error during the task (middle row), and whether participants attributed the trial to error at the end of the task (bottom row).}
\label{fig:was3fig}
\end{figure*}

Unexpectedly, participants in the perverse incentive condition did not share trials at lower rates than those in the compatible incentive condition.  They shared \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$falsification==1 & was3d$incentive==1 & was3d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$falsification==1 & was3d$incentive==1])))} trials when the feedback was disconfirming $(\Sexpr{prettyNum(100*mean(glmershf.i))}\%, SE = \Sexpr{prettyNum(100*glmershf.se.i)}\%)$ and \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$falsification==0 & was3d$incentive==1 & was3d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$falsification==0 & was3d$incentive==1])))} trials when it was affirming $(\Sexpr{prettyNum(100*mean(glmersha.i))}\%, SE = \Sexpr{prettyNum(100*glmersha.se.i)}\%)$, $t(520)$ = \Sexpr{prettyNum(mean(tsh.i))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsh.i),520)*2))}, $\emph{d} = \Sexpr{prettyNum(mean(tsh.i)/sqrt(523))}$.  They also shared \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$error==1 & was3d$incentive==1 & was3d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$error==1 & was3d$incentive==1])))} trials when they judged the feedback to be an error during the task $(\Sexpr{prettyNum(100*mean(glmersherr.i))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se.i)}\%)$ and \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$error==0 & was3d$incentive==1 & was3d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share[was3d$error==0 & was3d$incentive==1])))} trials when they judged the feedback to be accurate $(\Sexpr{prettyNum(100*mean(glmershnerr.i))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se.i)}\%)$, $t(520)$ = \Sexpr{prettyNum(mean(tsherr.i))}, \emph{p} $<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.i),520)*2))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr.i)/sqrt(523))}$.  At the end of the task, they shared \Sexpr{prettyNum(length(na.omit(was3d$share.final[was3d$share.final==1 & was3d$incentive==1 & was3d$false.final==1])))} of \Sexpr{prettyNum(length(na.omit(was3d$share.final[was3d$incentive==1 & was3d$false.final==1])))} trials that they judged to be an error $(\Sexpr{prettyNum(100*mean(glmersherr.final.i))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se.final.i)}\%)$ and \Sexpr{prettyNum(length(na.omit(was3d$share.final[was3d$share.final==1 & was3d$incentive==1 & was3d$false.final==0])))} of \Sexpr{prettyNum(length(na.omit(was3d$share.final[was3d$incentive==1 & was3d$false.final==0])))} trials that they judged to be accurate $(\Sexpr{prettyNum(100*mean(glmershnerr.final.i))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se.final.i)}\%)$, $t(481)$ = \Sexpr{prettyNum(mean(tsherr.final.i))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.final.i),481)*2))}, $d=$ \Sexpr{prettyNum(mean(tsherr.final.i)/sqrt(484))}$.

<<weak testing and selective reporting,echo=false,results=hide,fig=false>>=
scammer.id<-c(1,3,15,16,19,36,57,68,85,96)
nonscammer.id<-c(2,4,6,7,8,9,10,11,13,14,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,86,87,88,89,90,91,92,93,94,95,97,98,99,100)
sneaky.stoppers<-c(31,53,60,65,86,87,90,92,94)
why.share.all<-c(42,54,55,56,63,73,78,88,98,100)
was3d$selective<-ifelse(was3d$subjectid %in% scammer.id,1,0)

shared.all<-data.frame(shared.all=c(rep(NA,100)))
incent<-data.frame(incent=c(rep(NA,100)))
subjectid<-data.frame(subjectid=c(rep(NA,100)))
for(i in 1:100){
shared.all[i,1]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==i & was3d$falsification==1]))==0,NA,prod(na.omit(was3d$share[was3d$subjectid==i & was3d$falsification==1])))
incent[i,1]<-as.character(was3d$incentive[was3d$subjectid==i][1])
subjectid[i,1]<-i
}
shared.all.dat<-data.frame(shared.all,subjectid,incent,stringsAsFactors=FALSE)
shared.all.dat$shared.all<-as.factor(shared.all.dat$shared.all)
shared.all.dat$incent<-as.factor(shared.all.dat$incent)

                                 
sum(was3d$selective[was3d$incentive==0])/43
sum(was3d$selective[was3d$incentive==1])/43
was3d$hplus<-ifelse(was3d$num1==2 & was3d$num2==4 & was3d$num3==6,1,0)
hplusglmer<-glmer(hplus~incentive+(1|subjectid),data=was3d,family=binomial(link="logit"))

act.att<-sum(na.omit(was3d$share.final[was3d$actual.error==1 & was3d$false.final==1]))
act.att.total<-length(na.omit(was3d$share.final[was3d$actual.error==1 & was3d$false.final==1]))
act<-sum(na.omit(was3d$share.final[was3d$actual.error==1 & was3d$false.final==0]))
act.total<-length(na.omit(was3d$share.final[was3d$actual.error==1 & was3d$false.final==0]))
att<-sum(na.omit(was3d$share.final[was3d$actual.error==0 & was3d$false.final==1]))
att.total<-length(na.omit(was3d$share.final[was3d$actual.error==0 & was3d$false.final==1]))
acc<-sum(na.omit(was3d$share.final[was3d$actual.error==0 & was3d$false.final==0]))
acc.total<-length(na.omit(was3d$share.final[was3d$actual.error==0 & was3d$false.final==0]))

att.data<-na.omit(was3d[was3d$actual.error==0 & was3d$error==1,c("share.final","num1","num2","num3","falsification")])
att.data.nshare<-na.omit(was3d[was3d$actual.error==0 & was3d$false.final==1 & was3d$share.final==0,c("share.final","num1","num2","num3","falsification")])
att.data.share<-na.omit(was3d[was3d$actual.error==0 & was3d$false.final==1 & was3d$share.final==1,c("share.final","num1","num2","num3","falsification")])
att.data.share.aff<-na.omit(was3d[was3d$actual.error==0 & was3d$false.final==1 & was3d$share.final==1 & was3d$falsification==0,c("share.final","num1","num2","num3","falsification")])

act.data.nshare<-na.omit(was3d[was3d$actual.error==1 & was3d$false.final==0 & was3d$share.final==0,c("share.final","num1","num2","num3","falsification")])
act.data.share<-na.omit(was3d[was3d$actual.error==1 & was3d$false.final==0 & was3d$share.final==1,c("share.final","num1","num2","num3","falsification")])
act.data.share.aff<-na.omit(was3d[was3d$actual.error==1 & was3d$false.final==0 & was3d$share.final==1 & was3d$falsification==0,c("share.final","num1","num2","num3","falsification")])

false.final.glmer<-glmer(false.final~actual.error*falsification+(1|subjectid),data=was3d,family=binomial(link="logit"))
@ 

As seen in Figure~\ref{fig:was3fig}, there was significant variation across participants in their decisions to share data after receiving disconfirming feedback, $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershfee.i.chi))}, $p=$ \Sexpr{prettyNum(ptrunc(median(glmershfee.i.chip)))}, whether they shared data that they perceived to be error during the task, $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.i.chi))}, $p=$ \Sexpr{prettyNum(ptrunc(median(glmershatt.i.chip)))}, and whether they shared data that they perceived to be error at the end of the task, $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.final.i.chi))}, $p<$ \Sexpr{prettyNum(ptrunc(median(glmershatt.final.i.chip)))}.  For all three judgments, most participants in the perverse incentive condition shared all of their trials, with a minority sharing less.  

Our prediction was that some participants would be seduced by the perverse incentive, thus deciding only to share trials that were consistent with their final answer.  However, there was no difference between conditions in the probability of omitting data that were inconsistent with their final answer, $t(999)=$ \Sexpr{prettyNum(fixef(final.consistent.t)[4]/sqrt(diag(vcov(final.consistent.t))[4]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(final.consistent.t)[4]/sqrt(diag(vcov(final.consistent.t))[4]),999)*2))}.  A second way that participants could produce these results while exploiting the perverse incentive would be to seek out only affirming data, knowing the data would make a simple and convincing story.  One way to implement this weak testing strategy is to propose the (2,4,6) triple, knowing that they would receive affirming feedback unless the feedback is in error.  However, participants in the two incentive conditions were equally likely to propose (2,4,6) triples, $t(1154)=$ \Sexpr{prettyNum(abs(fixef(hplusglmer)[2]/sqrt(diag(vcov(hplusglmer))[2])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(hplusglmer)[2]/sqrt(diag(vcov(hplusglmer))[2]),1154)*2))}.

As participants were both accurate and consistent in their error attributions, they may have been able to remove actual errors from the data they shared.  Overall, at the end of the task participants shared \Sexpr{prettyNum(act.att)} of \Sexpr{prettyNum(act.att.total)} (\Sexpr{prettyNum(100*act.att/act.att.total)}\%) trials that were both actual errors and perceived as errors, \Sexpr{prettyNum(act)} of \Sexpr{prettyNum(act.total)} (\Sexpr{prettyNum(100*act/act.total)}\%) trials that were actual errors but not perceived as errors, \Sexpr{prettyNum(att)} of \Sexpr{prettyNum(att.total)} (\Sexpr{prettyNum(100*att/att.total)}\%) trials that were perceived as errors but not actual errors, and \Sexpr{prettyNum(acc)} of \Sexpr{prettyNum(acc.total)} (\Sexpr{prettyNum(100*acc/acc.total)}\%) trials that were neither perceived as error nor actual error.  When including both main effects and the interaction between actual error and attribution of error to predict whether each trial would be shared at the end of the task, there was only a significant main effect of error attribution, and not actual error, for both compatible and perverse conditions ($t(509)=$ \Sexpr{prettyNum(abs(fixef(share.should)[3]/sqrt(diag(vcov(share.should)))[3]))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should)[3]/sqrt(diag(vcov(share.should)))[3],500)*2))} vs. $t(479)=$ \Sexpr{prettyNum(abs(fixef(share.should.i)[3]/sqrt(diag(vcov(share.should.i)))[3]))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should.i)[3]/sqrt(diag(vcov(share.should.i)))[3],500)*2))}, respectively).  This means that error attributions, but not actual errors, matter in determining whether data is shared.  

The reason perceived and actual errors diverged was that disconfirmation had a systematic and additive effect on perceived error, even after controlling for actual error.  Main effects of both actual error ($t(1025)=$ \Sexpr{prettyNum(fixef(false.final.glmer)[2]/sqrt(diag(vcov(false.final.glmer))[2]))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(false.final.glmer)[2]/sqrt(diag(vcov(false.final.glmer))[2]),1025)*2))}) and disconfirming feedback ($t(1025)=$ \Sexpr{prettyNum(fixef(false.final.glmer)[3]/sqrt(diag(vcov(false.final.glmer))[3]))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(false.final.glmer)[3]/sqrt(diag(vcov(false.final.glmer))[3]),1025)*2))}) increased the chance of attributing a trial to error at the end of the task, with no significant interaction between the two ($t(1025)=$ \Sexpr{prettyNum(fixef(false.final.glmer)[4]/sqrt(diag(vcov(false.final.glmer))[4]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(false.final.glmer)[4]/sqrt(diag(vcov(false.final.glmer))[4]),1025)*2))}).  Thus, affirming trials were shared more often, as they were less likely to be perceived as errors than disconfirming trials even when they were actually errors, whereas disconfirming trials were shared less frequently because they were inappropriately seen as errors when they were not.

\subsection{Discussion}

Participants with a compatible or perverse incentive to share data were equally likely to attribute disconfirming feedback to error.  The financial penalty for making incorrect probability judgments and attributions to error produced greater consistency and accuracy, compared to Experiments One and Two.  Participants in both incentive conditions also shared fewer trials whose feedback was disconfirming or attributed to error, either during or at the end of the task.  Although participants were successful in identifying actual errors, it was attributions to error that determined whether they shared trials, indicating that being able identify error does not preclude failing to share trials with accurate disconfirmations, while sharing ones with inaccurate affirmations.

We expected the perverse incentive to reduce the consistency and accuracy of attributions to error, as well as to reduce the sharing of data attributed to error.  However, such motivated reasoning was not observed.  Rather, data sharing behavior in the two conditions differed in an unexpected way.  Both for decisions made after each trial and at the end of the task, participants in the perverse incentive condition shared \emph{more} data than those in the compatible incentive condition--thereby demonstrating a more ethical data sharing stance.  While it is possible that higher stakes, such as those involved in pharmaceutical or academic research, would lead to motivated reasoning and data sharing policies, participants responded to the moderate stakes used in this research with reasoned and ethical behavior.  

In decisions made at the end of all trials, however, some participants in the perverse incentive condition decided to share none of the data they attributed to error.  Contrary to our prediction, these participants did not omit more trials that were inconsistent with their final answer than those in the compatible incentive condition.  Additionally, those in the perverse incentive condition did not try to produce a convincing story in as few trials as possible, in order to reduce the risk of collecting inconvenient data that would make their Final Answer less convincing or requiring selective reporting.

There are several possible explanations for why participants in the perverse incentive condition shared trials at a higher rate than those in the compatible incentive condition.  First, they may have thought that the learner knows they can hide data, even though the instructions indicated that the other participant would only know about the trials they decided to share.  Second, they may have believed that sharing more trials increases the learner's confidence, regardless of whether the trials are consistent with their Final Answer.  Third, they may have been more strongly motivated to do the right thing and give the learner all the data available, even if that came at the cost of their own compensation.  Open-ended responses at the end of the task show four examples of such motivation:

\begin{quote}
\begin{enumerate}
\item ``\Sexpr{was3.t$V1096[68]}''
\item ``\Sexpr{was3.t$V1063[28]}''
\item ``\Sexpr{was3.t$V1063[29]}''
\item ``I shared everything because, not knowing if the FIT/DNF response by the computer was correct, I didn't want to deliberately bias the info I passed on by being selective.''
\end{enumerate}
\end{quote}

<<perverse.open,echo=false,results=hide,fig=false>>=
perverse.open1<-was3.t$V318
perverse.open2<-was3.t$V320
compatible.open1<-was3.t$V322
compatible.open2<-was3.t$V323
@ 

Thus, Experiment Three extends the positive test strategy to communication of results, seen in selective reporting, such that disconfirming data are seen as both caused by error and not worthy of sharing with others.  Contrary to our prediction of motivated reasoning \cite{kunda1990case}, the perverse incentive condition not only did not increase error attributions, but increased the sharing of data that were disconfirming or attributed to error.

\section{Experiment Four}

<<exp4pretest,echo=false,results=hide,fig=false>>=

a<-(339+cumsum(rep(c(4,2,1,1,1,1,1,1),38)))
b<-c(1,6,8,9,17,20:23,26,30,33:37,40,44,47:51,54,317,318,321,323,324:329,332,334,335:340)
c<-append(b,a)
c<-append(c,c(799,972:1057,1060,1061))
was4.t<-read.csv("Wason_Experiment_4_pre.csv",na.string="",skip=2,header=FALSE)
#was4<-was4.t[1:length(was4.t[,1]),c]
was4<-was4.t[1:length(was4.t[,1]),c]

g1<-c("subjectid","IP","start","end","open1","trial1.1","trial1.2","trial1.3","trial1.p.fit","trial1.feedback","open2","trial2.false","trial2.1","trial2.2","trial2.3","trial2.p.fit","trial2.feedback","open3","trial3.false","trial3.1","trial3.2","trial3.3","trial3.p.fit","trial3.feedback","bonus.self.compatible","bonus.other.compatible","open4","trial4.feedback","trial4.false","trial4.share","trial4.1","trial4.2","trial4.3","trial4.p.fit","open5","trial5.feedback","trial5.false","trial5.share","trial5.1","trial5.2","trial5.3","trial5.p.fit","open6","trial6.feedback","trial6.false","trial6.share","trial6.1","trial6.2","trial6.3","trial6.p.fit","open7","trial7.feedback","trial7.false","trial7.share","trial7.1","trial7.2","trial7.3","trial7.p.fit","open8","trial8.feedback","trial8.false","trial8.share","trial8.1","trial8.2","trial8.3","trial8.p.fit","open9","trial9.feedback","trial9.false","trial9.share","trial9.1","trial9.2","trial9.3","trial9.p.fit")
g1<-c(g1,c("open10","trial10.feedback","trial10.false","trial10.share","trial10.1","trial10.2","trial10.3","trial10.p.fit","open11","trial11.feedback","trial11.false","trial11.share","trial11.1","trial11.2","trial11.3","trial11.p.fit","open12","trial12.feedback","trial12.false","trial12.share","trial12.1","trial12.2","trial12.3","trial12.p.fit","open13","trial13.feedback","trial13.false","trial13.share","trial13.1","trial13.2","trial13.3","trial13.p.fit","open14","trial14.feedback","trial14.false","trial14.share","trial14.1","trial14.2","trial14.3","trial14.p.fit","open15","trial15.feedback","trial15.false","trial15.share","trial15.1","trial15.2","trial15.3","trial15.p.fit","open16","trial16.feedback","trial16.false","trial16.share","trial16.1","trial16.2","trial16.3","trial16.p.fit","open17","trial17.feedback","trial17.false","trial17.share","trial17.1","trial17.2","trial17.3","trial17.p.fit","open18","trial18.feedback","trial18.false","trial18.share","trial18.1","trial18.2","trial18.3","trial18.p.fit","open19","trial19.feedback","trial19.false","trial19.share","trial19.1","trial19.2","trial19.3","trial19.p.fit","open20","trial20.feedback","trial20.false","trial20.share","trial20.1","trial20.2","trial20.3","trial20.p.fit","open21","trial21.feedback","trial21.false","trial21.share","trial21.1","trial21.2","trial21.3","trial21.p.fit","open22","trial22.feedback","trial22.false","trial22.share","trial22.1","trial22.2","trial22.3","trial22.p.fit","open23","trial23.feedback","trial23.false","trial23.share","trial23.1","trial23.2","trial23.3","trial23.p.fit","open24","trial24.feedback","trial24.false","trial24.share","trial24.1","trial24.2","trial24.3","trial24.p.fit"))
g1<-c(g1,c("open25","trial25.feedback","trial25.false","trial25.share","trial25.1","trial25.2","trial25.3","trial25.p.fit","open26","trial26.feedback","trial26.false","trial26.share","trial26.1","trial26.2","trial26.3","trial26.p.fit","open27","trial27.feedback","trial27.false","trial27.share","trial27.1","trial27.2","trial27.3","trial27.p.fit","open28","trial28.feedback","trial28.false","trial28.share","trial28.1","trial28.2","trial28.3","trial28.p.fit","open29","trial29.feedback","trial29.false","trial29.share","trial29.1","trial29.2","trial29.3","trial29.p.fit","open30","trial30.feedback","trial30.false","trial30.share","trial30.1","trial30.2","trial30.3","trial30.p.fit","open31","trial31.feedback","trial31.false","trial31.share","trial31.1","trial31.2","trial31.3","trial31.p.fit","open32","trial32.feedback","trial32.false","trial32.share","trial32.1","trial32.2","trial32.3","trial32.p.fit","open33","trial33.feedback","trial33.false","trial33.share","trial33.1","trial33.2","trial33.3","trial33.p.fit","open34","trial34.feedback","trial34.false","trial34.share","trial34.1","trial34.2","trial34.3","trial34.p.fit","open35","trial35.feedback","trial35.false","trial35.share","trial35.1","trial35.2","trial35.3","trial35.p.fit","open36","trial36.feedback","trial36.false","trial36.share","trial36.1","trial36.2","trial36.3","trial36.p.fit"))
g1<-c(g1,c("open37","trial37.feedback","trial37.false","trial37.share","trial37.1","trial37.2","trial37.3","trial37.p.fit","open38","trial38.feedback","trial38.false","trial38.share","trial38.1","trial38.2","trial38.3","trial38.p.fit","open39","trial39.feedback","trial39.false","trial39.share","trial39.1","trial39.2","trial39.3","trial39.p.fit","open40","trial40.feedback","trial40.false","trial40.share","trial40.1","trial40.2","trial40.3","trial40.p.fit","open41","trial41.feedback","trial41.false","trial41.share","trial41.1","trial41.2","trial41.3","trial41.p.fit","open42","trial42.feedback","trial42.false","trial42.share","trial42.1","trial42.2","trial42.3","trial42.p.fit","open43","trial43.feedback","trial43.false","trial43.share","trial43.1","trial43.2","trial43.3","trial43.p.fit","final.answer"))

g1<-c(g1,c("trial1.false.final","trial2.false.final","trial3.false.final","trial4.false.final","trial5.false.final","trial6.false.final","trial7.false.final","trial8.false.final","trial9.false.final","trial10.false.final","trial11.false.final","trial12.false.final","trial13.false.final","trial14.false.final","trial15.false.final","trial16.false.final","trial17.false.final","trial18.false.final","trial19.false.final","trial20.false.final","trial21.false.final","trial22.false.final","trial23.false.final","trial24.false.final","trial25.false.final","trial26.false.final","trial27.false.final","trial28.false.final","trial29.false.final","trial30.false.final","trial31.false.final","trial32.false.final","trial33.false.final","trial34.false.final","trial35.false.final","trial36.false.final","trial37.false.final","trial38.false.final","trial39.false.final","trial40.false.final","trial41.false.final","trial42.false.final","trial43.false.final","trial1.share.final","trial2.share.final","trial3.share.final","trial4.share.final","trial5.share.final","trial6.share.final","trial7.share.final","trial8.share.final","trial9.share.final","trial10.share.final","trial11.share.final","trial12.share.final","trial13.share.final","trial14.share.final","trial15.share.final","trial16.share.final","trial17.share.final","trial18.share.final","trial19.share.final","trial20.share.final","trial21.share.final","trial22.share.final","trial23.share.final","trial24.share.final","trial25.share.final","trial26.share.final","trial27.share.final","trial28.share.final","trial29.share.final","trial30.share.final","trial31.share.final","trial32.share.final","trial33.share.final","trial34.share.final","trial35.share.final","trial36.share.final","trial37.share.final","trial38.share.final","trial39.share.final","trial40.share.final","trial41.share.final","trial42.share.final","trial43.share.final","gender","age"))

colnames(was4)<-g1

b<-matrix(NA,nrow=1,ncol=12)
b<-data.frame(b)
colnames(b)<-c("name","trial","open","feedback","error","share","num1","num2","num3","p.fit","false.final","share.final")
was4d<-b
was4d<-was4d[-1,]

for(i in 1:length(levels(as.factor(was4$subjectid)))){
name<-as.factor(rep(was4$subjectid[i],43))
final.answer<-as.factor(rep(was4$final.answer[i],43))
trial<-seq(1,43)

q<-c("FIT","DNF")

feedback<-c(factor(was4$trial1.feedback[i],levels=q),factor(was4$trial2.feedback[i],levels=q),factor(was4$trial3.feedback[i],levels=q),factor(was4$trial4.feedback[i],levels=q),factor(was4$trial5.feedback[i],levels=q),factor(was4$trial6.feedback[i],levels=q),factor(was4$trial7.feedback[i],levels=q),factor(was4$trial8.feedback[i],levels=q),factor(was4$trial9.feedback[i],levels=q),factor(was4$trial10.feedback[i],levels=q),factor(was4$trial11.feedback[i],levels=q),factor(was4$trial12.feedback[i],levels=q),factor(was4$trial13.feedback[i],levels=q),factor(was4$trial14.feedback[i],levels=q),factor(was4$trial15.feedback[i],levels=q),factor(was4$trial16.feedback[i],levels=q),factor(was4$trial17.feedback[i],levels=q),factor(was4$trial18.feedback[i],levels=q),factor(was4$trial19.feedback[i],levels=q),factor(was4$trial20.feedback[i],levels=q),factor(was4$trial21.feedback[i],levels=q),factor(was4$trial22.feedback[i],levels=q),factor(was4$trial23.feedback[i],levels=q),factor(was4$trial24.feedback[i],levels=q),factor(was4$trial25.feedback[i],levels=q),factor(was4$trial26.feedback[i],levels=q),factor(was4$trial27.feedback[i],levels=q),factor(was4$trial28.feedback[i],levels=q),factor(was4$trial29.feedback[i],levels=q),factor(was4$trial30.feedback[i],levels=q),factor(was4$trial31.feedback[i],levels=q),factor(was4$trial32.feedback[i],levels=q),factor(was4$trial33.feedback[i],levels=q),factor(was4$trial34.feedback[i],levels=q),factor(was4$trial35.feedback[i],levels=q),factor(was4$trial36.feedback[i],levels=q),factor(was4$trial37.feedback[i],levels=q),factor(was4$trial38.feedback[i],levels=q),factor(was4$trial39.feedback[i],levels=q),factor(was4$trial40.feedback[i],levels=q),factor(was4$trial41.feedback[i],levels=q),factor(was4$trial42.feedback[i],levels=q),factor(was4$trial43.feedback[i],levels=q))

error<-c(NA,was4$trial2.false[i],was4$trial3.false[i],was4$trial4.false[i],was4$trial5.false[i],was4$trial6.false[i],was4$trial7.false[i],was4$trial8.false[i],was4$trial9.false[i],was4$trial10.false[i],was4$trial11.false[i],was4$trial12.false[i],was4$trial13.false[i],was4$trial14.false[i],was4$trial15.false[i],was4$trial16.false[i],was4$trial17.false[i],was4$trial18.false[i],was4$trial19.false[i],was4$trial20.false[i],was4$trial21.false[i],was4$trial22.false[i],was4$trial23.false[i],was4$trial24.false[i],was4$trial25.false[i],was4$trial26.false[i],was4$trial27.false[i],was4$trial28.false[i],was4$trial29.false[i],was4$trial30.false[i],was4$trial31.false[i],was4$trial32.false[i],was4$trial33.false[i],was4$trial34.false[i],was4$trial35.false[i],was4$trial36.false[i],was4$trial37.false[i],was4$trial38.false[i],was4$trial39.false[i],was4$trial40.false[i],was4$trial41.false[i],was4$trial42.false[i],was4$trial43.false[i])

share<-c(NA,NA,NA,was4$trial4.share[i],was4$trial5.share[i],was4$trial6.share[i],was4$trial7.share[i],was4$trial8.share[i],was4$trial9.share[i],was4$trial10.share[i],was4$trial11.share[i],was4$trial12.share[i],was4$trial13.share[i],was4$trial14.share[i],was4$trial15.share[i],was4$trial16.share[i],was4$trial17.share[i],was4$trial18.share[i],was4$trial19.share[i],was4$trial20.share[i],was4$trial21.share[i],was4$trial22.share[i],was4$trial23.share[i],was4$trial24.share[i],was4$trial25.share[i],was4$trial26.share[i],was4$trial27.share[i],was4$trial28.share[i],was4$trial29.share[i],was4$trial30.share[i],was4$trial31.share[i],was4$trial32.share[i],was4$trial33.share[i],was4$trial34.share[i],was4$trial35.share[i],was4$trial36.share[i],was4$trial37.share[i],was4$trial38.share[i],was4$trial39.share[i],was4$trial40.share[i],was4$trial41.share[i],was4$trial42.share[i],was4$trial43.share[i])

num1<-c(was4$trial1.1[i],was4$trial2.1[i],was4$trial3.1[i],was4$trial4.1[i],was4$trial5.1[i],was4$trial6.1[i],was4$trial7.1[i],was4$trial8.1[i],was4$trial9.1[i],was4$trial10.1[i],was4$trial11.1[i],was4$trial12.1[i],was4$trial13.1[i],was4$trial14.1[i],was4$trial15.1[i],was4$trial16.1[i],was4$trial17.1[i],was4$trial18.1[i],was4$trial19.1[i],was4$trial20.1[i],was4$trial21.1[i],was4$trial22.1[i],was4$trial23.1[i],was4$trial24.1[i],was4$trial25.1[i],was4$trial26.1[i],was4$trial27.1[i],was4$trial28.1[i],was4$trial29.1[i],was4$trial30.1[i],was4$trial31.1[i],was4$trial32.1[i],was4$trial33.1[i],was4$trial34.1[i],was4$trial35.1[i],was4$trial36.1[i],was4$trial37.1[i],was4$trial38.1[i],was4$trial39.1[i],was4$trial40.1[i],was4$trial41.1[i],was4$trial42.1[i],was4$trial43.1[i])

num2<-c(was4$trial1.2[i],was4$trial2.2[i],was4$trial3.2[i],was4$trial4.2[i],was4$trial5.2[i],was4$trial6.2[i],was4$trial7.2[i],was4$trial8.2[i],was4$trial9.2[i],was4$trial10.2[i],was4$trial11.2[i],was4$trial12.2[i],was4$trial13.2[i],was4$trial14.2[i],was4$trial15.2[i],was4$trial16.2[i],was4$trial17.2[i],was4$trial18.2[i],was4$trial19.2[i],was4$trial20.2[i],was4$trial21.2[i],was4$trial22.2[i],was4$trial23.2[i],was4$trial24.2[i],was4$trial25.2[i],was4$trial26.2[i],was4$trial27.2[i],was4$trial28.2[i],was4$trial29.2[i],was4$trial30.2[i],was4$trial31.2[i],was4$trial32.2[i],was4$trial33.2[i],was4$trial34.2[i],was4$trial35.2[i],was4$trial36.2[i],was4$trial37.2[i],was4$trial38.2[i],was4$trial39.2[i],was4$trial40.2[i],was4$trial41.2[i],was4$trial42.2[i],was4$trial43.2[i])

num3<-c(was4$trial1.3[i],was4$trial2.3[i],was4$trial3.3[i],was4$trial4.3[i],was4$trial5.3[i],was4$trial6.3[i],was4$trial7.3[i],was4$trial8.3[i],was4$trial9.3[i],was4$trial10.3[i],was4$trial11.3[i],was4$trial12.3[i],was4$trial13.3[i],was4$trial14.3[i],was4$trial15.3[i],was4$trial16.3[i],was4$trial17.3[i],was4$trial18.3[i],was4$trial19.3[i],was4$trial20.3[i],was4$trial21.3[i],was4$trial22.3[i],was4$trial23.3[i],was4$trial24.3[i],was4$trial25.3[i],was4$trial26.3[i],was4$trial27.3[i],was4$trial28.3[i],was4$trial29.3[i],was4$trial30.3[i],was4$trial31.3[i],was4$trial32.3[i],was4$trial33.3[i],was4$trial34.3[i],was4$trial35.3[i],was4$trial36.3[i],was4$trial37.3[i],was4$trial38.3[i],was4$trial39.3[i],was4$trial40.3[i],was4$trial41.3[i],was4$trial42.3[i],was4$trial43.3[i])

p.fit<-c(was4$trial1.p.fit[i],was4$trial2.p.fit[i],was4$trial3.p.fit[i],was4$trial4.p.fit[i],was4$trial5.p.fit[i],was4$trial6.p.fit[i],was4$trial7.p.fit[i],was4$trial8.p.fit[i],was4$trial9.p.fit[i],was4$trial10.p.fit[i],was4$trial11.p.fit[i],was4$trial12.p.fit[i],was4$trial13.p.fit[i],was4$trial14.p.fit[i],was4$trial15.p.fit[i],was4$trial16.p.fit[i],was4$trial17.p.fit[i],was4$trial18.p.fit[i],was4$trial19.p.fit[i],was4$trial20.p.fit[i],was4$trial21.p.fit[i],was4$trial22.p.fit[i],was4$trial23.p.fit[i],was4$trial24.p.fit[i],was4$trial25.p.fit[i],was4$trial26.p.fit[i],was4$trial27.p.fit[i],was4$trial28.p.fit[i],was4$trial29.p.fit[i],was4$trial30.p.fit[i],was4$trial31.p.fit[i],was4$trial32.p.fit[i],was4$trial33.p.fit[i],was4$trial34.p.fit[i],was4$trial35.p.fit[i],was4$trial36.p.fit[i],was4$trial37.p.fit[i],was4$trial38.p.fit[i],was4$trial39.p.fit[i],was4$trial40.p.fit[i],was4$trial41.p.fit[i],was4$trial42.p.fit[i],was4$trial43.p.fit[i])

false.final<-c(was4$trial1.false.final[i],was4$trial2.false.final[i],was4$trial3.false.final[i],was4$trial4.false.final[i],was4$trial5.false.final[i],was4$trial6.false.final[i],was4$trial7.false.final[i],was4$trial8.false.final[i],was4$trial9.false.final[i],was4$trial10.false.final[i],was4$trial11.false.final[i],was4$trial12.false.final[i],was4$trial13.false.final[i],was4$trial14.false.final[i],was4$trial15.false.final[i],was4$trial16.false.final[i],was4$trial17.false.final[i],was4$trial18.false.final[i],was4$trial19.false.final[i],was4$trial20.false.final[i],was4$trial21.false.final[i],was4$trial22.false.final[i],was4$trial23.false.final[i],was4$trial24.false.final[i],was4$trial25.false.final[i],was4$trial26.false.final[i],was4$trial27.false.final[i],was4$trial28.false.final[i],was4$trial29.false.final[i],was4$trial30.false.final[i],was4$trial31.false.final[i],was4$trial32.false.final[i],was4$trial33.false.final[i],was4$trial34.false.final[i],was4$trial35.false.final[i],was4$trial36.false.final[i],was4$trial37.false.final[i],was4$trial38.false.final[i],was4$trial39.false.final[i],was4$trial40.false.final[i],was4$trial41.false.final[i],was4$trial42.false.final[i],was4$trial43.false.final[i])

share.final<-c(was4$trial1.share.final[i],was4$trial2.share.final[i],was4$trial3.share.final[i],was4$trial4.share.final[i],was4$trial5.share.final[i],was4$trial6.share.final[i],was4$trial7.share.final[i],was4$trial8.share.final[i],was4$trial9.share.final[i],was4$trial10.share.final[i],was4$trial11.share.final[i],was4$trial12.share.final[i],was4$trial13.share.final[i],was4$trial14.share.final[i],was4$trial15.share.final[i],was4$trial16.share.final[i],was4$trial17.share.final[i],was4$trial18.share.final[i],was4$trial19.share.final[i],was4$trial20.share.final[i],was4$trial21.share.final[i],was4$trial22.share.final[i],was4$trial23.share.final[i],was4$trial24.share.final[i],was4$trial25.share.final[i],was4$trial26.share.final[i],was4$trial27.share.final[i],was4$trial28.share.final[i],was4$trial29.share.final[i],was4$trial30.share.final[i],was4$trial31.share.final[i],was4$trial32.share.final[i],was4$trial33.share.final[i],was4$trial34.share.final[i],was4$trial35.share.final[i],was4$trial36.share.final[i],was4$trial37.share.final[i],was4$trial38.share.final[i],was4$trial39.share.final[i],was4$trial40.share.final[i],was4$trial41.share.final[i],was4$trial42.share.final[i],was4$trial43.share.final[i])

false.final<-false.final%%2
share.final<-share.final%%2

a<-data.frame(name,trial,open,feedback,error,share,num1,num2,num3,p.fit,false.final,share.final,final.answer,stringsAsFactors=FALSE)
was4d<-rbind(was4d,a)
}
 
TFTR<-ifelse(was4d$num1<was4d$num2 & was4d$num2<was4d$num3 & was4d$num1%%2==0 & (was4d$num2-was4d$num1)==2 & (was4d$num3-was4d$num2)==2 & was4d$num1>=2 & was4d$num3<=100 & (was4d$num1/2)%%2!=0,1,0)
was4d<-cbind(was4d,TFTR)
actual.error<-ifelse((was4d$TFTR==1 & was4d$feedback==2) | (was4d$TFTR==0 & was4d$feedback==1),1,0)
was4d<-cbind(was4d,actual.error)
##During task error attributions:1=True; 2=False##
##During task sharing: 1=Yes; 2=No##
##Final error attributions:1=False;2=True##
##Final Sharing:1=Share; 2=dont share####
was4d$error.should<-ifelse(is.na(was4d$feedback)==TRUE,NA,0)
was4d$error.should[was4d$feedback==2 & was4d$p.fit>80]<-1
was4d$error.should[was4d$feedback==1 & was4d$p.fit<20]<-1
was4d$error.should[was4d$feedback==2 & was4d$p.fit==80]<-NA
was4d$error.should[was4d$feedback==1 & was4d$p.fit==20]<-NA

was4d$cons.tp<-ifelse(was4d$error.should==1 & was4d$error==1,1,0)
was4d$cons.tn<-ifelse(was4d$error.should==0 & was4d$error==0,1,0)
was4d$cons.fp<-ifelse(was4d$error.should==0 & was4d$error==1,1,0)
was4d$cons.fn<-ifelse(was4d$error.should==1 & was4d$error==0,1,0)

was4d$subjectid<-as.numeric(was4d$name)
was4d$falsification<-was4d$feedback-1
was4d$error<-was4d$error-1
was4d$share<-was4d$share%%2

unique.id<-was4.t[,c("V1070","V1")]
qqq<-levels(unique.id$V1)
for(i in 1:length(qqq)){
was4d$unique.id[was4d$name==qqq[i]]<-as.character(unique.id$V1075[unique.id$V1==qqq[i]])
}

##Control: Nested Boostrap##
chip.pre<-c()
phip.pre<-c()
phi.p.pre<-c()
chip.final<-c()
phip.final<-c()
phi.p.final<-c()
glmeraa<-c()
glmerff<-c()
glmeraa.final<-c()
glmerff.final<-c()
glmershnerr<-c()
glmersherr<-c()
glmershnerr.final<-c()
glmersherr.final<-c()
glmersha<-c()
glmershf<-c()
tfals.pre<-c()
tfals.final<-c()
tsh.pre<-c()
tsherr.pre<-c()
tsherr.final.pre<-c()
icc.shatt.final<-c()
icc.shatt<-c()
icc.shfee<-c()
glmershatt.final.chi.pre<-c()
glmershatt.final.chip.pre<-c()
glmershfee.chi<-c()
glmershfee.chip<-c()
glmershatt.chi<-c()
glmershatt.chip<-c()
qf<-was4d
##For each observation in the dataset make a zero##
qf$new.id<-c(rep(0,length(qf$subjectid)))
for(i in 1:n3){
##obtain the id numbers of subjects we want##
a<-as.numeric(levels(as.factor(as.character(qf$subjectid))))
##Sort a sample from these subjects##
a<-sort(sample(a,size=length(a),replace=TRUE))
##Make some new IDs for the bootstrap sample##
new.id<-seq(length(a))
##Make a data frame holding the old and new ID numbers##
a<-cbind(a,new.id)
a<-data.frame(a)
q1<-data.frame()
####
##For each ID number##
for(j in 1:length(a[,2])){
##The participant with subjectID equal to the jth ID number gets a new id numer equal to j##
  qf$new.id[qf$subjectid==a$a[j]]<-j
  ##Add this new participant to the bootstrapped sample##
q1<-rbind(q1,qf[qf$subjectid==a$a[j],])
} 
glmerfals<-glmer(error~falsification+(1|new.id),data=q1,family=binomial(link="logit"))
glmeraa[i]<-invlogit(fixef(glmerfals)[1])
glmerff[i]<-invlogit(fixef(glmerfals)[1]+fixef(glmerfals)[2])
tfals.pre[i]<-fixef(glmerfals)[2]/sqrt(diag(vcov(glmerfals))[2])

glmerfals.final<-glmer(false.final~falsification+(1|new.id),data=q1,family=binomial(link="logit"))
glmeraa.final[i]<-invlogit(fixef(glmerfals.final)[1])
glmerff.final[i]<-invlogit(fixef(glmerfals.final)[1]+fixef(glmerfals.final)[2])
tfals.final[i]<-fixef(glmerfals.final)[2]/sqrt(diag(vcov(glmerfals.final))[2])

glmerphi<-glmer(actual.error~error+(1|new.id),data=q1,family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1,family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.pre[i]<-nova$Chisq[2]
phip.pre[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1$error)))
phi.p.pre[i]<-nova[2,7]

glmerphi<-glmer(actual.error~false.final+(1|new.id),data=q1,family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1,family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.final[i]<-nova$Chisq[2]
phip.final[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1$false.final)))
phi.p.final[i]<-nova[2,7]

glmershfee<-glmer(share~falsification+(falsification|new.id),data=q1,family=binomial(link="logit"))
glmershfee.int<-glmer(share~falsification+(1|new.id),data=q1,family=binomial(link="logit"))
glmersha[i]<-invlogit(fixef(glmershfee.int)[1])
glmershf[i]<-invlogit(fixef(glmershfee.int)[1]+fixef(glmershfee.int)[2])
glmershfee.anova<-anova(glmershfee,glmershfee.int)
glmershfee.chi[i]<-glmershfee.anova$Chisq[2]
glmershfee.chip[i]<-glmershfee.anova[2,7]
lmershfee<-lmer(share~falsification+(falsification|new.id),data=q1)
icc.shfee[i]<-(as.numeric(summary(lmershfee)@REmat[,4][2]))/(as.numeric(summary(lmershfee)@REmat[,4][1])+as.numeric(summary(lmershfee)@REmat[,4][2])+as.numeric(summary(lmershfee)@REmat[,4][3]))
tsh.pre[i]<-abs(fixef(glmershfee.int)[2]/sqrt(diag(vcov(glmershfee.int))[2]))

glmershatt<-glmer(share~error+(error|new.id),data=q1,family=binomial(link="logit"))
glmershatt.int<-glmer(share~error+(1|new.id),data=q1,family=binomial(link="logit"))
glmershnerr[i]<-invlogit(fixef(glmershatt.int)[1])
glmersherr[i]<-invlogit(fixef(glmershatt.int)[1]+fixef(glmershatt.int)[2])
glmershatt.anova<-anova(glmershatt,glmershatt.int)
glmershatt.chi[i]<-glmershatt.anova$Chisq[2]
glmershatt.chip[i]<-glmershatt.anova[2,7]
lmershatt<-lmer(share~error+(error|new.id),data=q1)
icc.shatt[i]<-(as.numeric(summary(lmershatt)@REmat[,4][2]))/(as.numeric(summary(lmershatt)@REmat[,4][1])+as.numeric(summary(lmershatt)@REmat[,4][2])+as.numeric(summary(lmershatt)@REmat[,4][3]))
tsherr.pre[i]<-abs(fixef(glmershatt.int)[2]/sqrt(diag(vcov(glmershatt.int))[2]))

glmershatt.final<-glmer(share.final~false.final+(false.final|new.id),data=q1,family=binomial(link="logit"))
glmershatt.final.int<-glmer(share.final~false.final+(1|new.id),data=q1,family=binomial(link="logit"))
glmershnerr.final[i]<-invlogit(fixef(glmershatt.final.int)[1])
glmersherr.final[i]<-invlogit(fixef(glmershatt.final.int)[1]+fixef(glmershatt.final.int)[2])
glmershatt.final.anova<-anova(glmershatt.final,glmershatt.final.int)
glmershatt.final.chi.pre[i]<-glmershatt.final.anova$Chisq[2]
glmershatt.final.chip.pre[i]<-glmershatt.final.anova[2,7]
lmershatt.final<-lmer(share.final~false.final+(false.final|new.id),data=q1)
icc.shatt.final[i]<-(as.numeric(summary(lmershatt.final)@REmat[,4][2]))/(as.numeric(summary(lmershatt.final)@REmat[,4][1])+as.numeric(summary(lmershatt.final)@REmat[,4][2])+as.numeric(summary(lmershatt.final)@REmat[,4][3]))
tsherr.final.pre[i]<-abs(fixef(glmershatt.final.int)[2]/sqrt(diag(vcov(glmershatt.final.int))[2]))
}
glmeraa.se<-sd(glmeraa)
glmerff.se<-sd(glmerff)
glmeraa.se.final<-sd(glmeraa.final)
glmerff.se.final<-sd(glmerff.final)
glmershf.se<-sd(glmershf)
glmersha.se<-sd(glmersha)
glmershnerr.se<-sd(glmershnerr)
glmersherr.se<-sd(glmersherr)
glmershnerr.se.final<-sd(glmershnerr.final)
glmersherr.se.final<-sd(glmersherr.final)
###
glmer.ov<-glmer(error.should~error+(1|subjectid),data=was4d,family=binomial(link="logit"))
glmer.ov.null<-glmer(error.should~(1|subjectid),data=was4d,family=binomial(link="logit"))
nova.ov<-anova(glmer.ov.null,glmer.ov)
chi.ov.pre<-nova.ov$Chisq[2]
phi.ov.pre<-sqrt(chi.ov/length(na.omit(was4d$actual.error)))
##Trials##
was4d$complete<-ifelse(is.na(was4d$feedback)==FALSE,1,0)
trials<-c()
incentive<-c()
for(i in 1:length(levels(as.factor(was4d$subjectid)))){
trials[i]<-sum(was4d$complete[was4d$subjectid==i])
}
trialsd<-trials
##
glmerfals.pre<-glmer(error~falsification+(1|subjectid),data=was4d,family=binomial(link="logit"))
glmershfee.pre<-glmer(share~falsification+(1|subjectid),data=was4d,family=binomial(link="logit"))
glmershatt.pre<-glmer(share~error+(1|subjectid),data=was4d,family=binomial(link="logit"))
glmershatt.final.pre<-glmer(share.final~false.final+(1|subjectid),data=was4d,family=binomial(link="logit"))
@ 

Experiment Three found that participants given a perverse incentive shared more trials that were disconfirming or attributed to error than those given a compatible incentive.  On the surface it appears that they were genuinely willing benefit others, at potential financial cost to themselves.  To test this explanation, at the end of Experiment Four all participants were told the Actual Rule and then were allowed to modify the data they shared, but not adjust their Final Answer.  Thus, if participants given a perverse incentive care about ethics and altruism they should change the data they share to match the correct answer, even at the likely cost to their own payoff.  However, if other concerns determine their data sharing, such as uncertainty about whether trials were errors, then knowing the correct answer should allow them to share only trials that are consistent with their Final Answer.\footnote{To promote greater exploration of the hypothesis space and give more disconfirming feedback, a pre-test for Experiment Four added an additional condition to the rule: that only \emph{odd multiples of two} fit the rule.  Unfortunately, this did not increase the median number of trials completed (\Sexpr{prettyNum(median(trialsd))}).  All other results replicated:  They were more likely to see feedback as in error when it was disconfirming than when it was affirming, ($t(322)=$ \Sexpr{prettyNum(mean(tfals.pre))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals.pre),322)))}, $d=$ \Sexpr{prettyNum(mean(tfals.pre)/sqrt(324))}; Bayesian Consistency $\phi=$ \Sexpr{prettyNum(phi.ov.pre)}, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi.ov.pre)}, $p<$ \Sexpr{prettyNum(ptrunc(dchisq(chi.ov.pre,1)))}; accuracy ($\chi^{2}(1) = \Sexpr{prettyNum(mean(chip.pre))}$, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p.pre)))}, $\phi = \Sexpr{prettyNum(mean(phip.pre))}$); and data sharing after disconfirmation $t(263)$ = \Sexpr{prettyNum(mean(tsh.pre))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsh.pre),263)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsh.pre)/sqrt(265))}$; data sharing after error $t(259)$ = \Sexpr{prettyNum(mean(tsherr.pre))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.pre),259)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr.pre)/sqrt(259))}$; end of task $t(373)$ = \Sexpr{prettyNum(mean(tsherr.final.pre))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.final.pre),373)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr.final.pre)/sqrt(375))}$ with significnat heterogeneity $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.final.chi.pre))}, $p=$ \Sexpr{prettyNum(ptrunc(median(glmershatt.final.chip.pre)))}.}

Experiment Four also seeks to rule out two alternative explanations for the data sharing results of Experiment Three.  Participants may have thought that the person receiving the data knew they could hide trials, hence might become suspicious if the data were too orderly.  To clarify that this was not possible, we modified the wording to be clear that the other person cannot know that they collected more trials than they shared, if they decide to do so:

\begin{quote}
  ``We are also interested in how people share information.  The information comes in trials.  A trial is a page where you proposed a triple and received feedback.  For each trial you share, another person will get the triple you proposed and the feedback you received.  This person only knows about the trials you share.  This person does not know how many trials you completed or that you did not have to share all of your trials.''
 \end{quote}

Second, explicitly mentioning the other person may evoke concerns about the welfare of the person receiving the data.  Similarly, data sharing judgments were worded as ``information sharing'', possibly sending the message to participants in the perverse incentive condition that they should share, rather than hide, data.  Instead, some participants may wish to deceive the other person, but perceived that the `sharing' label provided by the experimenter meant that concern for the other person, rather than deception, is the expected behavior, introducing a demand characteristic \cite{orne1962social,weber1972subject,nichols2008good}.  To control this, we used more neutral language, where all mentions of `sharing' were changed to `communicate', and any mention of the other participant was removed, wherever possible.  For example, the trial-by-trial judgments were changed from:

\begin{quote}
  Do you think this trial should be shared with a new participant?
\end{quote}

to

\begin{quote}
Do you think this trial should be communicated?
\end{quote}

This wording was supposed to allow participants to decide whether the data communication was about sharing or deception themselves, rather than try to infer what the experimenter wants.  

\subsection{Method}

<<exp4,echo=false,results=hide,fig=false>>=

#solved1<-was4.t[95,1277]

a<-(355+cumsum(rep(c(4,2,1,1,1,1,1,1),37)))
b<-c(1,6,8,9,17,20:23,26,30,33:37,40,44,47:51,54,317,318,320,322,325,327:333,336,338:344,347,349:355)
c<-append(b,a)
c<-append(c,c(803,976:1061,1234:1276,1279,1280,1312))
was4.t<-read.csv("Wason_Experiment_4.csv",na.string="",skip=2,header=FALSE)
was4<-was4.t[1:length(was4.t[,1]),c]
  
g1<-c("subjectid","IP","start","end","open1","trial1.1","trial1.2","trial1.3","trial1.p.fit","trial1.feedback","open2","trial2.false","trial2.1","trial2.2","trial2.3","trial2.p.fit","trial2.feedback","open3","trial3.false","trial3.1","trial3.2","trial3.3","trial3.p.fit","trial3.feedback","bonus.self.compatible","bonus.other.compatible","bonus.self.perverse","bonus.other.perverse","open4","trial4.feedback","trial4.false","trial4.share","trial4.1","trial4.2","trial4.3","trial4.p.fit","open5","trial5.feedback","trial5.false","trial5.share","trial5.1","trial5.2","trial5.3","trial5.p.fit","open6","trial6.feedback","trial6.false","trial6.share","trial6.1","trial6.2","trial6.3","trial6.p.fit","open7","trial7.feedback","trial7.false","trial7.share","trial7.1","trial7.2","trial7.3","trial7.p.fit","open8","trial8.feedback","trial8.false","trial8.share","trial8.1","trial8.2","trial8.3","trial8.p.fit","open9","trial9.feedback","trial9.false","trial9.share","trial9.1","trial9.2","trial9.3","trial9.p.fit")
g1<-c(g1,c("open10","trial10.feedback","trial10.false","trial10.share","trial10.1","trial10.2","trial10.3","trial10.p.fit","open11","trial11.feedback","trial11.false","trial11.share","trial11.1","trial11.2","trial11.3","trial11.p.fit","open12","trial12.feedback","trial12.false","trial12.share","trial12.1","trial12.2","trial12.3","trial12.p.fit","open13","trial13.feedback","trial13.false","trial13.share","trial13.1","trial13.2","trial13.3","trial13.p.fit","open14","trial14.feedback","trial14.false","trial14.share","trial14.1","trial14.2","trial14.3","trial14.p.fit","open15","trial15.feedback","trial15.false","trial15.share","trial15.1","trial15.2","trial15.3","trial15.p.fit","open16","trial16.feedback","trial16.false","trial16.share","trial16.1","trial16.2","trial16.3","trial16.p.fit","open17","trial17.feedback","trial17.false","trial17.share","trial17.1","trial17.2","trial17.3","trial17.p.fit","open18","trial18.feedback","trial18.false","trial18.share","trial18.1","trial18.2","trial18.3","trial18.p.fit","open19","trial19.feedback","trial19.false","trial19.share","trial19.1","trial19.2","trial19.3","trial19.p.fit","open20","trial20.feedback","trial20.false","trial20.share","trial20.1","trial20.2","trial20.3","trial20.p.fit","open21","trial21.feedback","trial21.false","trial21.share","trial21.1","trial21.2","trial21.3","trial21.p.fit","open22","trial22.feedback","trial22.false","trial22.share","trial22.1","trial22.2","trial22.3","trial22.p.fit","open23","trial23.feedback","trial23.false","trial23.share","trial23.1","trial23.2","trial23.3","trial23.p.fit","open24","trial24.feedback","trial24.false","trial24.share","trial24.1","trial24.2","trial24.3","trial24.p.fit"))
g1<-c(g1,c("open25","trial25.feedback","trial25.false","trial25.share","trial25.1","trial25.2","trial25.3","trial25.p.fit","open26","trial26.feedback","trial26.false","trial26.share","trial26.1","trial26.2","trial26.3","trial26.p.fit","open27","trial27.feedback","trial27.false","trial27.share","trial27.1","trial27.2","trial27.3","trial27.p.fit","open28","trial28.feedback","trial28.false","trial28.share","trial28.1","trial28.2","trial28.3","trial28.p.fit","open29","trial29.feedback","trial29.false","trial29.share","trial29.1","trial29.2","trial29.3","trial29.p.fit","open30","trial30.feedback","trial30.false","trial30.share","trial30.1","trial30.2","trial30.3","trial30.p.fit","open31","trial31.feedback","trial31.false","trial31.share","trial31.1","trial31.2","trial31.3","trial31.p.fit","open32","trial32.feedback","trial32.false","trial32.share","trial32.1","trial32.2","trial32.3","trial32.p.fit","open33","trial33.feedback","trial33.false","trial33.share","trial33.1","trial33.2","trial33.3","trial33.p.fit","open34","trial34.feedback","trial34.false","trial34.share","trial34.1","trial34.2","trial34.3","trial34.p.fit","open35","trial35.feedback","trial35.false","trial35.share","trial35.1","trial35.2","trial35.3","trial35.p.fit","open36","trial36.feedback","trial36.false","trial36.share","trial36.1","trial36.2","trial36.3","trial36.p.fit"))
g1<-c(g1,c("open37","trial37.feedback","trial37.false","trial37.share","trial37.1","trial37.2","trial37.3","trial37.p.fit","open38","trial38.feedback","trial38.false","trial38.share","trial38.1","trial38.2","trial38.3","trial38.p.fit","open39","trial39.feedback","trial39.false","trial39.share","trial39.1","trial39.2","trial39.3","trial39.p.fit","open40","trial40.feedback","trial40.false","trial40.share","trial40.1","trial40.2","trial40.3","trial40.p.fit","open41","trial41.feedback","trial41.false","trial41.share","trial41.1","trial41.2","trial41.3","trial41.p.fit","open42","trial42.feedback","trial42.false","trial42.share","trial42.1","trial42.2","trial42.3","trial42.p.fit","open43","trial43.feedback","trial43.false","trial43.share","trial43.1","trial43.2","trial43.3","trial43.p.fit","final.answer","trial1.false.final","trial2.false.final","trial3.false.final","trial4.false.final","trial5.false.final","trial6.false.final","trial7.false.final","trial8.false.final","trial9.false.final","trial10.false.final"))
g1<-c(g1,c("trial11.false.final","trial12.false.final","trial13.false.final","trial14.false.final","trial15.false.final","trial16.false.final","trial17.false.final","trial18.false.final","trial19.false.final","trial20.false.final","trial21.false.final","trial22.false.final","trial23.false.final","trial24.false.final","trial25.false.final","trial26.false.final","trial27.false.final","trial28.false.final","trial29.false.final","trial30.false.final","trial31.false.final","trial32.false.final","trial33.false.final","trial34.false.final","trial35.false.final","trial36.false.final","trial37.false.final","trial38.false.final","trial39.false.final","trial40.false.final","trial41.false.final","trial42.false.final","trial43.false.final","trial1.share.final","trial2.share.final","trial3.share.final","trial4.share.final","trial5.share.final","trial6.share.final","trial7.share.final","trial8.share.final","trial9.share.final","trial10.share.final","trial11.share.final","trial12.share.final","trial13.share.final","trial14.share.final","trial15.share.final","trial16.share.final","trial17.share.final","trial18.share.final","trial19.share.final","trial20.share.final","trial21.share.final","trial22.share.final","trial23.share.final","trial24.share.final","trial25.share.final","trial26.share.final","trial27.share.final","trial28.share.final","trial29.share.final","trial30.share.final","trial31.share.final","trial32.share.final","trial33.share.final","trial34.share.final","trial35.share.final","trial36.share.final","trial37.share.final","trial38.share.final","trial39.share.final","trial40.share.final","trial41.share.final","trial42.share.final","trial43.share.final"))
g1<-c(g1,c("trial1.share.final.A","trial2.share.final.A","trial3.share.final.A","trial4.share.final.A","trial5.share.final.A","trial6.share.final.A","trial7.share.final.A","trial8.share.final.A","trial9.share.final.A","trial10.share.final.A","trial11.share.final.A","trial12.share.final.A","trial13.share.final.A","trial14.share.final.A","trial15.share.final.A","trial16.share.final.A","trial17.share.final.A","trial18.share.final.A","trial19.share.final.A","trial20.share.final.A","trial21.share.final.A","trial22.share.final.A","trial23.share.final.A","trial24.share.final.A","trial25.share.final.A","trial26.share.final.A","trial27.share.final.A","trial28.share.final.A","trial29.share.final.A","trial30.share.final.A","trial31.share.final.A","trial32.share.final.A","trial33.share.final.A","trial34.share.final.A","trial35.share.final.A","trial36.share.final.A","trial37.share.final.A","trial38.share.final.A","trial39.share.final.A","trial40.share.final.A","trial41.share.final.A","trial42.share.final.A","trial43.share.final.A","gender","age","incentive"))

colnames(was4)<-g1

##H+tests for final answer##
#score(asc,con,evn,2,100)
trial<-seq(1,43)
p1<-c(1,1,1,1,1,1,rep(NA,37))
a1<-cbind(trial,p1)
score.1<-c(0,0,1,0,0)
p2<-c(1,1,1,1,1,1,rep(NA,37))
a2<-cbind(trial,p2)
score.2<-c(1,1,0,0,0)
p3<-c(rep(NA,43))
a3<-cbind(trial,p3)
score.3<-c(NA,NA,NA,NA,NA)
p4<-c(1,1,1,1,1,1,1,1,rep(NA,35))
a4<-cbind(trial,p4)
score.4<-c(0,0,0,0,0)
p5<-c(1,1,0,1,1,1,1,0,0,1,rep(NA,33))
a5<-cbind(trial,p5)
score.5<-c(0,0,1,0,1)
p6<-c(0,1,0,0,1,0,0,0,0,1,1,1,rep(NA,31))
a6<-cbind(trial,p6)
score.6<-c(1,0,1,1,0)
p7<-c(0,0,0,0,0,rep(NA,38))
a7<-cbind(trial,p7)
score.7<-c(0,0,0,0,0) #weird: only tested add 2 but said add 10#
p8<-c(0,1,1,1,1,1,rep(NA,37))
a8<-cbind(trial,p8)
score.8<-c(0,1,1,0,0)
p9<-c(1,1,1,1,1,1,rep(NA,37))
a9<-cbind(trial,p9)
score.9<-c(1,1,0,0,0)
p10<-c(1,1,1,1,0,0,1,rep(NA,36))
a10<-cbind(trial,p10)
score.10<-c(0,0,1,0,0)
p11<-c(1,1,0,1,1,0,rep(NA,37))
a11<-cbind(trial,p11)
score.11<-c(0,0,1,0,0)
p12<-c(1,0,0,1,0,0,1,0,1,0,1,1,rep(NA,31))
a12<-cbind(trial,p12)
score.12<-c(1,1,1,0,0)
p13<-c(0,1,1,1,1,1,rep(NA,37))
a13<-cbind(trial,p13)
score.13<-c(0,0,1,0,0)
p14<-c(1,1,1,1,0,0,rep(NA,37))
a14<-cbind(trial,p14)
score.14<-c(1,1,1,0,0)
p15<-c(0,1,0,0,1,1,rep(NA,37))
a15<-cbind(trial,p15)
score.15<-c(1,1,0,0,0)
p16<-c(1,1,1,1,1,1,rep(NA,37))
a16<-cbind(trial,p16)
score.16<-c(0,0,1,0,0)
p17<-c(1,1,1,1,1,1,rep(NA,37))
a17<-cbind(trial,p17)
score.17<-c(1,1,0,0,0)
p18<-c(1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,rep(NA,28))
a18<-cbind(trial,p18)
score.18<-c(1,1,1,0,1)
p19<-c(0,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,rep(NA,27))
a19<-cbind(trial,p19)
score.19<-c(1,1,1,0,0)
p20<-c(1,1,1,1,1,1,rep(NA,37))
a20<-cbind(trial,p20)
score.20<-c(0,0,1,0,0)
p21<-c(1,1,1,1,1,1,rep(NA,37))
a21<-cbind(trial,p21)
score.21<-c(0,1,1,0,0)
p22<-c(rep(NA,43))
a22<-cbind(trial,p22)
score.22<-c(NA,NA,NA,NA,NA)
p23<-c(1,1,1,1,1,1,rep(NA,37))
a23<-cbind(trial,p23)
score.23<-c(1,1,1,0,0)
p24<-c(1,1,1,1,1,1,rep(NA,37))
a24<-cbind(trial,p24)
score.24<-c(1,1,1,1,0)
p25<-c(1,1,1,1,1,1,rep(NA,37))
a25<-cbind(trial,p25)
score.25<-c(1,1,0,0,0)
p26<-c(1,0,1,0,1,0,1,1,1,0,1,1,rep(NA,31))
a26<-cbind(trial,p26)
score.26<-c(1,1,1,0,0)
p27<-c(1,0,1,1,1,1,rep(NA,37))
a27<-cbind(trial,p27)
score.27<-c(1,1,1,0,0)
p28<-c(1,1,1,1,1,1,1,1,1,rep(NA,34))
a28<-cbind(trial,p28)
score.28<-c(1,1,0,0,0)
p29<-c(1,1,1,0,0,1,1,1,1,1,1,1,rep(NA,31))
a29<-cbind(trial,p29)
score.29<-c(1,0,1,0,0)
p30<-c(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,rep(NA,23))
a30<-cbind(trial,p30)
score.30<-c(1,1,1,1,0)
p31<-c(rep(NA,43))
a31<-cbind(trial,p31)
score.31<-c(NA,NA,NA,NA,NA)
p32<-c(0,1,1,1,1,1,rep(NA,37))
a32<-cbind(trial,p32)
score.32<-c(0,1,0,0,0)
p33<-c(NA,1,1,1,1,1,rep(NA,37))
a33<-cbind(trial,p33)
score.33<-c(0,1,1,0,0)
p34<-c(1,1,1,1,1,1,0,rep(NA,36))
a34<-cbind(trial,p34)
score.34<-c(0,0,1,0,0)
p35<-c(0,1,1,1,1,1,1,rep(NA,36))
a35<-cbind(trial,p35)
score.35<-c(1,1,0,0,0)
p36<-c(1,1,1,1,0,1,1,1,1,1,rep(NA,33))
a36<-cbind(trial,p36)
score.36<-c(1,1,0,0,0)
p37<-c(1,1,1,1,1,1,rep(NA,37))
a37<-cbind(trial,p37)
score.37<-c(1,1,1,0,0)
p38<-c(1,1,1,1,1,1,rep(NA,37))
a38<-cbind(trial,p38)
score.38<-c(0,0,0,0,0)
p39<-c(1,1,0,0,0,1,1,0,0,1,0,0,1,0,0,1,rep(NA,27))
a39<-cbind(trial,p39)
score.39<-c(1,1,1,1,1)
p40<-c(0,0,0,1,1,1,rep(NA,37))
a40<-cbind(trial,p40)
score.40<-c(1,1,1,0,0)
p41<-c(rep(NA,43))
a41<-cbind(trial,p41)
score.41<-c(NA,NA,NA,NA,NA)
p42<-c(rep(NA,43))
a42<-cbind(trial,p42)
score.42<-c(NA,NA,NA,NA,NA)
p43<-c(1,1,1,1,1,1,rep(NA,37))
a43<-cbind(trial,p43)
score.43<-c(0,0,1,1,0)
p44<-c(0,0,0,0,0,0,0,0,0,0,rep(NA,33))
a44<-cbind(trial,p44)
score.44<-c(1,0,0,0,0)
p45<-c(rep(NA,43))
a45<-cbind(trial,p45)
score.45<-c(NA,NA,NA,NA,NA)
p46<-c(1,1,1,1,0,1,rep(NA,37))
a46<-cbind(trial,p46)
score.46<-c(1,1,0,0,0)
p47<-c(1,0,0,0,1,1,rep(NA,37))
a47<-cbind(trial,p47)
score.47<-c(1,1,0,0,0)
p48<-c(1,1,0,1,1,1,1,1,1,1,1,1,1,1,rep(NA,29))
a48<-cbind(trial,p48)
score.48<-c(1,1,1,0,0)
p49<-c(1,1,1,1,0,0,1,1,rep(NA,35))
a49<-cbind(trial,p49)
score.49<-c(0,0,1,0,0)
p50<-c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,rep(NA,26))
a50<-cbind(trial,p50)
score.50<-c(1,1,0,0,0)
p51<-c(1,1,0,1,1,1,1,rep(NA,36))
a51<-cbind(trial,p51)
score.51<-c(1,1,0,0,0)
p52<-c(1,1,1,1,1,1,rep(NA,37))
a52<-cbind(trial,p52)
score.52<-c(0,0,1,0,0)
p53<-c(0,1,1,1,1,0,0,1,rep(NA,35))
a53<-cbind(trial,p53)
score.53<-c(1,1,0,0,0)
p54<-c(1,1,1,1,1,1,rep(NA,37))
a54<-cbind(trial,p54)
score.54<-c(0,0,1,0,0)
p55<-c(1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,rep(NA,24))
a55<-cbind(trial,p55)
score.55<-c(1,1,1,0,0)
p56<-c(1,1,1,1,1,0,1,0,rep(NA,35))
a56<-cbind(trial,p56)
score.56<-c(0,1,1,0,0)
p57<-c(0,1,1,0,1,1,rep(NA,37))
a57<-cbind(trial,p57)
score.57<-c(0,0,0,0,0)
p58<-c(1,1,1,1,1,1,rep(NA,37))
a58<-cbind(trial,p58)
score.58<-c(0,1,1,0,0)
p59<-c(0,0,0,0,1,1,rep(NA,37))
a59<-cbind(trial,p59)
score.59<-c(1,0,0,0,0)
p60<-c(0,0,0,0,0,1,rep(NA,37))
a60<-cbind(trial,p60)
score.60<-c(0,1,0,0,0)
p61<-c(1,1,1,0,0,0,1,1,0,1,0,0,0,1,1,rep(NA,28))
a61<-cbind(trial,p61)
score.61<-c(1,1,0,0,1)
p62<-c(1,0,1,1,1,1,rep(NA,37))
a62<-cbind(trial,p62)
score.62<-c(1,1,1,0,0)
p63<-c(1,1,1,1,1,1,1,rep(NA,36))
a63<-cbind(trial,p63)
score.63<-c(1,1,0,0,0)
p64<-c(1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,rep(NA,13))
a64<-cbind(trial,p64)
score.64<-c(1,1,1,0,0)
p65<-c(0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,rep(NA,26))
a65<-cbind(trial,p65)
score.65<-c(0,1,1,0,0)
p66<-c(1,1,1,1,1,1,1,rep(NA,36))
a66<-cbind(trial,p66)
score.66<-c(0,0,1,0,0)
p67<-c(1,0,0,1,0,1,0,1,rep(NA,35))
a67<-cbind(trial,p67)
score.67<-c(1,1,1,0,0)
p68<-c(0,0,0,1,1,1,1,1,rep(NA,35))
a68<-cbind(trial,p68)
score.68<-c(1,1,1,0,0)
p69<-c(rep(NA,43))
a69<-cbind(trial,p69)
score.69<-c(NA,NA,NA,NA,NA)
p70<-c(1,1,1,1,1,0,1,1,1,1,1,1,1,rep(NA,30))
a70<-cbind(trial,p70)
score.70<-c(0,1,1,0,0)
p71<-c(rep(NA,43))
a71<-cbind(trial,p71)
score.71<-c(NA,NA,NA,NA,NA)
p72<-c(1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,NA)
a72<-cbind(trial,p72)
score.72<-c(0,1,1,0,0)
p73<-c(1,1,1,1,1,1,1,1,rep(NA,35))
a73<-cbind(trial,p73)
score.73<-c(1,1,0,0,0)
p74<-c(1,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,NA,NA)
a74<-cbind(trial,p74)
score.74<-c(1,0,1,0,0)
p75<-c(1,1,1,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,0,1,0,rep(NA,20))
a75<-cbind(trial,p75)
score.75<-c(1,1,1,0,0)
p76<-c(1,1,1,1,1,1,rep(NA,37))
a76<-cbind(trial,p76)
score.76<-c(1,1,0,0,0)
p77<-c(1,0,1,0,1,1,rep(NA,37))
a77<-cbind(trial,p77)
score.77<-c(0,1,1,0,0)
p78<-c(1,1,1,1,1,1,rep(NA,37))
a78<-cbind(trial,p78)
score.78<-c(1,1,0,0,0)
p79<-c(0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,rep(NA,26))
a79<-cbind(trial,p79)
score.79<-c(0,0,1,0,0)
p80<-c(1,1,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0,1,rep(NA,25))
a80<-cbind(trial,p80)
score.80<-c(0,1,1,0,1)
p81<-c(0,0,0,1,1,1,1,rep(NA,36))
a81<-cbind(trial,p81)
score.81<-c(1,1,1,1,0)
p82<-c(1,1,1,1,1,1,1,rep(NA,36))
a82<-cbind(trial,p82)
score.82<-c(1,1,1,0,0)
p83<-c(1,1,1,1,1,1,1,1,1,1,rep(NA,33))
a83<-cbind(trial,p83)
score.83<-c(1,1,0,0,0)
p84<-c(1,1,1,1,1,1,rep(NA,37))
a84<-cbind(trial,p84)
score.84<-c(1,1,1,0,0)
p85<-c(1,1,1,1,0,1,0,0,1,0,0,1,1,0,1,0,0,0,0,0,0,0,1,0,0,1,1,rep(NA,16))
a85<-cbind(trial,p85)
score.85<-c(1,1,1,1,1)
p86<-c(1,1,1,1,0,0,rep(NA,37))
a86<-cbind(trial,p86)
score.86<-c(1,1,0,0,0)
p87<-c(1,0,0,0,0,0,1,1,rep(NA,35))
a87<-cbind(trial,p87)
score.87<-c(0,0,1,0,0)
p88<-c(1,1,1,1,0,0,1,rep(NA,36))
a88<-cbind(trial,p88)
score.88<-c(1,1,1,0,0)
p89<-c(1,1,1,1,1,1,1,1,1,1,rep(NA,33))
a89<-cbind(trial,p89)
score.89<-c(1,1,1,0,0)
p90<-c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,rep(NA,29))
a90<-cbind(trial,p90)
score.90<-c(1,1,0,0,0)
p91<-c(1,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
a91<-cbind(trial,p91)
score.91<-c(1,1,1,1,0)
p92<-c(1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,rep(NA,23))
a92<-cbind(trial,p92)
score.92<-c(1,0,1,0,0)
p93<-c(1,1,1,1,1,1,1,1,1,1,1,rep(NA,32))
a93<-cbind(trial,p93)
score.93<-c(1,0,0,0,0)
p94<-c(1,1,1,1,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,rep(NA,21))
a94<-cbind(trial,p94)
score.94<-c(1,1,1,1,0)
p95<-c(0,0,1,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,rep(NA,12))
a95<-cbind(trial,p95)
score.95<-c(1,1,1,0,1)
p96<-c(1,1,1,1,0,0,0,0,1,1,1,1,1,0,1,1,0,1,1,0,0,1,0,1,rep(NA,19))
a96<-cbind(trial,p96)
score.96<-c(0,0,1,0,0)
p97<-c(0,1,1,0,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,rep(NA,22))
a97<-cbind(trial,p97)
score.97<-c(1,1,1,0,0)
p98<-c(1,1,0,1,1,1,1,1,rep(NA,35))
a98<-cbind(trial,p98)
score.98<-c(1,1,1,0,0)
p99<-c(1,1,0,1,1,0,0,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,1,0,1,rep(NA,18))
a99<-cbind(trial,p99)
score.99<-c(1,1,1,0,0)
p100<-c(0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,rep(NA,15))
a100<-cbind(trial,p100)
score.100<-c(1,1,1,0,0)
p101<-c(1,1,1,1,0,1,1,0,1,rep(NA,34))
a101<-cbind(trial,p101)
score.101<-c(1,0,0,0,0)
p102<-c(1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,0,0,rep(NA,26))
a102<-cbind(trial,p102)
score.102<-c(1,1,1,1,1)
p103<-c(0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,1,0,0,0,1,rep(NA,14))
a103<-cbind(trial,p103)
score.103<-c(1,0,1,0,0)
p104<-c(1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,rep(NA,26))
a104<-cbind(trial,p104)
score.104<-c(1,1,1,0,0)
p105<-c(0,1,1,0,1,0,1,1,0,1,rep(NA,33))
a105<-cbind(trial,p105)
score.105<-c(1,1,1,0,0)
p106<-c(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NA)
a106<-cbind(trial,p106)
score.106<-c(1,1,1,0,0)
p107<-c(1,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,rep(NA,24))
a107<-cbind(trial,p107)
score.107<-c(1,1,0,0,0)
p108<-c(1,0,0,1,1,1,rep(NA,37))
a108<-cbind(trial,p108)
score.108<-c(0,0,1,0,0)
p109<-c(0,1,1,0,0,0,0,0,1,1,1,0,0,1,0,1,1,1,1,1,0,0,0,0,0,rep(NA,18))
a109<-cbind(trial,p109)
score.109<-c(1,1,1,0,0)
p110<-c(1,1,1,0,1,0,1,rep(NA,36))
a110<-cbind(trial,p110)
score.110<-c(1,1,0,0,0)
p111<-c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,rep(NA,27))
a111<-cbind(trial,p111)
score.111<-c(1,1,0,0,0)
p112<-c(1,1,1,1,1,1,rep(NA,37))
a112<-cbind(trial,p112)
score.112<-c(1,1,0,0,0)
p113<-c(1,1,1,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,rep(NA,19))
a113<-cbind(trial,p113)
score.113<-c(1,1,1,0,0)
p114<-c(1,1,0,1,1,1,rep(NA,37))
a114<-cbind(trial,p114)
score.114<-c(1,1,0,0,0)
p115<-c(rep(NA,43))
a115<-cbind(trial,p115)
score.115<-c(NA,NA,NA,NA,NA)
p116<-c(1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1,0,1,0,0,1)
a116<-cbind(trial,p116)
score.116<-c(1,1,1,0,1)
p117<-c(1,1,0,1,0,1,rep(NA,37))
a117<-cbind(trial,p117)
score.117<-c(1,1,1,0,0)
p118<-c(1,1,1,1,1,1,1,1,rep(NA,35))
a118<-cbind(trial,p118)
score.118<-c(0,0,1,1,0)
p119<-c(1,1,1,1,1,1,rep(NA,37))
a119<-cbind(trial,p119)
score.119<-c(1,1,0,0,0)
p120<-c(1,1,1,1,1,1,1,0,1,1,1,1,1,rep(NA,30))
a120<-cbind(trial,p120)
score.120<-c(1,1,0,0,0)
p121<-c(0,1,1,1,1,1,rep(NA,37))
a121<-cbind(trial,p121)
score.121<-c(1,1,1,0,0)
p122<-c(0,0,1,0,1,0,1,rep(NA,36))
a122<-cbind(trial,p122)
score.122<-c(1,1,1,0,0)
p123<-c(1,1,1,1,1,1,rep(NA,37))
a123<-cbind(trial,p123)
score.123<-c(1,1,0,0,0)

cons<-data.frame(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31,p32,p33,p34,p35,p36,p37,p38,p39,p40,p41,p42,p43,p44,p45,p46,p47,p48,p49,p50,p51,p52,p53,p54,p55,p56,p57,p58,p59,p60,p61,p62,p63,p64,p65,p66,p67,p68,p69,p70,p71,p72,p73,p74,p75,p76,p77,p78,p79,p80,p81,p82,p83,p84,p85,p86,p87,p88,p89,p90,p91,p92,p93,p94,p95,p96,p97,p98,p99,p100,p101,p102,p103,p104,p105,p106,p107,p108,p109,p110,p111,p112,p113,p114,p115,p116,p117,p118,p119,p120,p121,p122,p123)
cons<-t(cons)
colnames(cons)<-c("trial1.cons","trial2.cons","trial3.cons","trial4.cons","trial5.cons","trial6.cons","trial7.cons","trial8.cons","trial9.cons","trial10.cons","trial11.cons","trial12.cons","trial13.cons","trial14.cons","trial15.cons","trial16.cons","trial17.cons","trial18.cons","trial19.cons","trial20.cons","trial21.cons","trial22.cons","trial23.cons","trial24.cons","trial25.cons","trial26.cons","trial27.cons","trial28.cons","trial29.cons","trial30.cons","trial31.cons","trial32.cons","trial33.cons","trial34.cons","trial35.cons","trial36.cons","trial37.cons","trial38.cons","trial39.cons","trial40.cons","trial41.cons","trial42.cons","trial43.cons")

#a<-t(was4[123,])     
#V1289

was4<-cbind(was4,cons)

b<-matrix(NA,nrow=1,ncol=15)
b<-data.frame(b)
colnames(b)<-c("name","trial","open","feedback","error","share","num1","num2","num3","p.fit","false.final","share.final","incentive","share.final.A","cons")
was4d<-b
was4d<-was4d[-1,]

for(i in 1:length(levels(as.factor(was4$subjectid)))){
name<-as.factor(rep(was4$subjectid[i],43))
final.answer<-as.factor(rep(was4$final.answer[i],43))
trial<-seq(1,43)
incentive<-rep(was4$incentive[was4$subjectid[i]],43)
  
q<-c("FIT","DNF")

cons<-c(was4$trial1.cons[i],was4$trial2.cons[i],was4$trial3.cons[i],was4$trial4.cons[i],was4$trial5.cons[i],was4$trial6.cons[i],was4$trial7.cons[i],was4$trial8.cons[i],was4$trial9.cons[i],was4$trial10.cons[i],was4$trial11.cons[i],was4$trial12.cons[i],was4$trial13.cons[i],was4$trial14.cons[i],was4$trial15.cons[i],was4$trial16.cons[i],was4$trial17.cons[i],was4$trial18.cons[i],was4$trial19.cons[i],was4$trial20.cons[i],was4$trial21.cons[i],was4$trial22.cons[i],was4$trial23.cons[i],was4$trial24.cons[i],was4$trial25.cons[i],was4$trial26.cons[i],was4$trial27.cons[i],was4$trial28.cons[i],was4$trial29.cons[i],was4$trial30.cons[i],was4$trial31.cons[i],was4$trial32.cons[i],was4$trial33.cons[i],was4$trial34.cons[i],was4$trial35.cons[i],was4$trial36.cons[i],was4$trial37.cons[i],was4$trial38.cons[i],was4$trial39.cons[i],was4$trial40.cons[i],was4$trial41.cons[i],was4$trial42.cons[i],was4$trial43.cons[i])

feedback<-c(factor(was4$trial1.feedback[i],levels=q),factor(was4$trial2.feedback[i],levels=q),factor(was4$trial3.feedback[i],levels=q),factor(was4$trial4.feedback[i],levels=q),factor(was4$trial5.feedback[i],levels=q),factor(was4$trial6.feedback[i],levels=q),factor(was4$trial7.feedback[i],levels=q),factor(was4$trial8.feedback[i],levels=q),factor(was4$trial9.feedback[i],levels=q),factor(was4$trial10.feedback[i],levels=q),factor(was4$trial11.feedback[i],levels=q),factor(was4$trial12.feedback[i],levels=q),factor(was4$trial13.feedback[i],levels=q),factor(was4$trial14.feedback[i],levels=q),factor(was4$trial15.feedback[i],levels=q),factor(was4$trial16.feedback[i],levels=q),factor(was4$trial17.feedback[i],levels=q),factor(was4$trial18.feedback[i],levels=q),factor(was4$trial19.feedback[i],levels=q),factor(was4$trial20.feedback[i],levels=q),factor(was4$trial21.feedback[i],levels=q),factor(was4$trial22.feedback[i],levels=q),factor(was4$trial23.feedback[i],levels=q),factor(was4$trial24.feedback[i],levels=q),factor(was4$trial25.feedback[i],levels=q),factor(was4$trial26.feedback[i],levels=q),factor(was4$trial27.feedback[i],levels=q),factor(was4$trial28.feedback[i],levels=q),factor(was4$trial29.feedback[i],levels=q),factor(was4$trial30.feedback[i],levels=q),factor(was4$trial31.feedback[i],levels=q),factor(was4$trial32.feedback[i],levels=q),factor(was4$trial33.feedback[i],levels=q),factor(was4$trial34.feedback[i],levels=q),factor(was4$trial35.feedback[i],levels=q),factor(was4$trial36.feedback[i],levels=q),factor(was4$trial37.feedback[i],levels=q),factor(was4$trial38.feedback[i],levels=q),factor(was4$trial39.feedback[i],levels=q),factor(was4$trial40.feedback[i],levels=q),factor(was4$trial41.feedback[i],levels=q),factor(was4$trial42.feedback[i],levels=q),factor(was4$trial43.feedback[i],levels=q))

error<-c(NA,was4$trial2.false[i],was4$trial3.false[i],was4$trial4.false[i],was4$trial5.false[i],was4$trial6.false[i],was4$trial7.false[i],was4$trial8.false[i],was4$trial9.false[i],was4$trial10.false[i],was4$trial11.false[i],was4$trial12.false[i],was4$trial13.false[i],was4$trial14.false[i],was4$trial15.false[i],was4$trial16.false[i],was4$trial17.false[i],was4$trial18.false[i],was4$trial19.false[i],was4$trial20.false[i],was4$trial21.false[i],was4$trial22.false[i],was4$trial23.false[i],was4$trial24.false[i],was4$trial25.false[i],was4$trial26.false[i],was4$trial27.false[i],was4$trial28.false[i],was4$trial29.false[i],was4$trial30.false[i],was4$trial31.false[i],was4$trial32.false[i],was4$trial33.false[i],was4$trial34.false[i],was4$trial35.false[i],was4$trial36.false[i],was4$trial37.false[i],was4$trial38.false[i],was4$trial39.false[i],was4$trial40.false[i],was4$trial41.false[i],was4$trial42.false[i],was4$trial43.false[i])

share<-c(NA,NA,NA,was4$trial4.share[i],was4$trial5.share[i],was4$trial6.share[i],was4$trial7.share[i],was4$trial8.share[i],was4$trial9.share[i],was4$trial10.share[i],was4$trial11.share[i],was4$trial12.share[i],was4$trial13.share[i],was4$trial14.share[i],was4$trial15.share[i],was4$trial16.share[i],was4$trial17.share[i],was4$trial18.share[i],was4$trial19.share[i],was4$trial20.share[i],was4$trial21.share[i],was4$trial22.share[i],was4$trial23.share[i],was4$trial24.share[i],was4$trial25.share[i],was4$trial26.share[i],was4$trial27.share[i],was4$trial28.share[i],was4$trial29.share[i],was4$trial30.share[i],was4$trial31.share[i],was4$trial32.share[i],was4$trial33.share[i],was4$trial34.share[i],was4$trial35.share[i],was4$trial36.share[i],was4$trial37.share[i],was4$trial38.share[i],was4$trial39.share[i],was4$trial40.share[i],was4$trial41.share[i],was4$trial42.share[i],was4$trial43.share[i])

num1<-c(was4$trial1.1[i],was4$trial2.1[i],was4$trial3.1[i],was4$trial4.1[i],was4$trial5.1[i],was4$trial6.1[i],was4$trial7.1[i],was4$trial8.1[i],was4$trial9.1[i],was4$trial10.1[i],was4$trial11.1[i],was4$trial12.1[i],was4$trial13.1[i],was4$trial14.1[i],was4$trial15.1[i],was4$trial16.1[i],was4$trial17.1[i],was4$trial18.1[i],was4$trial19.1[i],was4$trial20.1[i],was4$trial21.1[i],was4$trial22.1[i],was4$trial23.1[i],was4$trial24.1[i],was4$trial25.1[i],was4$trial26.1[i],was4$trial27.1[i],was4$trial28.1[i],was4$trial29.1[i],was4$trial30.1[i],was4$trial31.1[i],was4$trial32.1[i],was4$trial33.1[i],was4$trial34.1[i],was4$trial35.1[i],was4$trial36.1[i],was4$trial37.1[i],was4$trial38.1[i],was4$trial39.1[i],was4$trial40.1[i],was4$trial41.1[i],was4$trial42.1[i],was4$trial43.1[i])

num2<-c(was4$trial1.2[i],was4$trial2.2[i],was4$trial3.2[i],was4$trial4.2[i],was4$trial5.2[i],was4$trial6.2[i],was4$trial7.2[i],was4$trial8.2[i],was4$trial9.2[i],was4$trial10.2[i],was4$trial11.2[i],was4$trial12.2[i],was4$trial13.2[i],was4$trial14.2[i],was4$trial15.2[i],was4$trial16.2[i],was4$trial17.2[i],was4$trial18.2[i],was4$trial19.2[i],was4$trial20.2[i],was4$trial21.2[i],was4$trial22.2[i],was4$trial23.2[i],was4$trial24.2[i],was4$trial25.2[i],was4$trial26.2[i],was4$trial27.2[i],was4$trial28.2[i],was4$trial29.2[i],was4$trial30.2[i],was4$trial31.2[i],was4$trial32.2[i],was4$trial33.2[i],was4$trial34.2[i],was4$trial35.2[i],was4$trial36.2[i],was4$trial37.2[i],was4$trial38.2[i],was4$trial39.2[i],was4$trial40.2[i],was4$trial41.2[i],was4$trial42.2[i],was4$trial43.2[i])

num3<-c(was4$trial1.3[i],was4$trial2.3[i],was4$trial3.3[i],was4$trial4.3[i],was4$trial5.3[i],was4$trial6.3[i],was4$trial7.3[i],was4$trial8.3[i],was4$trial9.3[i],was4$trial10.3[i],was4$trial11.3[i],was4$trial12.3[i],was4$trial13.3[i],was4$trial14.3[i],was4$trial15.3[i],was4$trial16.3[i],was4$trial17.3[i],was4$trial18.3[i],was4$trial19.3[i],was4$trial20.3[i],was4$trial21.3[i],was4$trial22.3[i],was4$trial23.3[i],was4$trial24.3[i],was4$trial25.3[i],was4$trial26.3[i],was4$trial27.3[i],was4$trial28.3[i],was4$trial29.3[i],was4$trial30.3[i],was4$trial31.3[i],was4$trial32.3[i],was4$trial33.3[i],was4$trial34.3[i],was4$trial35.3[i],was4$trial36.3[i],was4$trial37.3[i],was4$trial38.3[i],was4$trial39.3[i],was4$trial40.3[i],was4$trial41.3[i],was4$trial42.3[i],was4$trial43.3[i])

p.fit<-c(was4$trial1.p.fit[i],was4$trial2.p.fit[i],was4$trial3.p.fit[i],was4$trial4.p.fit[i],was4$trial5.p.fit[i],was4$trial6.p.fit[i],was4$trial7.p.fit[i],was4$trial8.p.fit[i],was4$trial9.p.fit[i],was4$trial10.p.fit[i],was4$trial11.p.fit[i],was4$trial12.p.fit[i],was4$trial13.p.fit[i],was4$trial14.p.fit[i],was4$trial15.p.fit[i],was4$trial16.p.fit[i],was4$trial17.p.fit[i],was4$trial18.p.fit[i],was4$trial19.p.fit[i],was4$trial20.p.fit[i],was4$trial21.p.fit[i],was4$trial22.p.fit[i],was4$trial23.p.fit[i],was4$trial24.p.fit[i],was4$trial25.p.fit[i],was4$trial26.p.fit[i],was4$trial27.p.fit[i],was4$trial28.p.fit[i],was4$trial29.p.fit[i],was4$trial30.p.fit[i],was4$trial31.p.fit[i],was4$trial32.p.fit[i],was4$trial33.p.fit[i],was4$trial34.p.fit[i],was4$trial35.p.fit[i],was4$trial36.p.fit[i],was4$trial37.p.fit[i],was4$trial38.p.fit[i],was4$trial39.p.fit[i],was4$trial40.p.fit[i],was4$trial41.p.fit[i],was4$trial42.p.fit[i],was4$trial43.p.fit[i])

false.final<-c(was4$trial1.false.final[i],was4$trial2.false.final[i],was4$trial3.false.final[i],was4$trial4.false.final[i],was4$trial5.false.final[i],was4$trial6.false.final[i],was4$trial7.false.final[i],was4$trial8.false.final[i],was4$trial9.false.final[i],was4$trial10.false.final[i],was4$trial11.false.final[i],was4$trial12.false.final[i],was4$trial13.false.final[i],was4$trial14.false.final[i],was4$trial15.false.final[i],was4$trial16.false.final[i],was4$trial17.false.final[i],was4$trial18.false.final[i],was4$trial19.false.final[i],was4$trial20.false.final[i],was4$trial21.false.final[i],was4$trial22.false.final[i],was4$trial23.false.final[i],was4$trial24.false.final[i],was4$trial25.false.final[i],was4$trial26.false.final[i],was4$trial27.false.final[i],was4$trial28.false.final[i],was4$trial29.false.final[i],was4$trial30.false.final[i],was4$trial31.false.final[i],was4$trial32.false.final[i],was4$trial33.false.final[i],was4$trial34.false.final[i],was4$trial35.false.final[i],was4$trial36.false.final[i],was4$trial37.false.final[i],was4$trial38.false.final[i],was4$trial39.false.final[i],was4$trial40.false.final[i],was4$trial41.false.final[i],was4$trial42.false.final[i],was4$trial43.false.final[i])

share.final<-c(was4$trial1.share.final[i],was4$trial2.share.final[i],was4$trial3.share.final[i],was4$trial4.share.final[i],was4$trial5.share.final[i],was4$trial6.share.final[i],was4$trial7.share.final[i],was4$trial8.share.final[i],was4$trial9.share.final[i],was4$trial10.share.final[i],was4$trial11.share.final[i],was4$trial12.share.final[i],was4$trial13.share.final[i],was4$trial14.share.final[i],was4$trial15.share.final[i],was4$trial16.share.final[i],was4$trial17.share.final[i],was4$trial18.share.final[i],was4$trial19.share.final[i],was4$trial20.share.final[i],was4$trial21.share.final[i],was4$trial22.share.final[i],was4$trial23.share.final[i],was4$trial24.share.final[i],was4$trial25.share.final[i],was4$trial26.share.final[i],was4$trial27.share.final[i],was4$trial28.share.final[i],was4$trial29.share.final[i],was4$trial30.share.final[i],was4$trial31.share.final[i],was4$trial32.share.final[i],was4$trial33.share.final[i],was4$trial34.share.final[i],was4$trial35.share.final[i],was4$trial36.share.final[i],was4$trial37.share.final[i],was4$trial38.share.final[i],was4$trial39.share.final[i],was4$trial40.share.final[i],was4$trial41.share.final[i],was4$trial42.share.final[i],was4$trial43.share.final[i])

share.final.A<-c(was4$trial1.share.final.A[i],was4$trial2.share.final.A[i],was4$trial3.share.final.A[i],was4$trial4.share.final.A[i],was4$trial5.share.final.A[i],was4$trial6.share.final.A[i],was4$trial7.share.final.A[i],was4$trial8.share.final.A[i],was4$trial9.share.final.A[i],was4$trial10.share.final.A[i],was4$trial11.share.final.A[i],was4$trial12.share.final.A[i],was4$trial13.share.final.A[i],was4$trial14.share.final.A[i],was4$trial15.share.final.A[i],was4$trial16.share.final.A[i],was4$trial17.share.final.A[i],was4$trial18.share.final.A[i],was4$trial19.share.final.A[i],was4$trial20.share.final.A[i],was4$trial21.share.final.A[i],was4$trial22.share.final.A[i],was4$trial23.share.final.A[i],was4$trial24.share.final.A[i],was4$trial25.share.final.A[i],was4$trial26.share.final.A[i],was4$trial27.share.final.A[i],was4$trial28.share.final.A[i],was4$trial29.share.final.A[i],was4$trial30.share.final.A[i],was4$trial31.share.final.A[i],was4$trial32.share.final.A[i],was4$trial33.share.final.A[i],was4$trial34.share.final.A[i],was4$trial35.share.final.A[i],was4$trial36.share.final.A[i],was4$trial37.share.final.A[i],was4$trial38.share.final.A[i],was4$trial39.share.final.A[i],was4$trial40.share.final.A[i],was4$trial41.share.final.A[i],was4$trial42.share.final.A[i],was4$trial43.share.final.A[i])

false.final<-false.final%%2
share.final<-share.final%%2
share.final.A<-share.final.A%%2

a<-data.frame(name,trial,open,feedback,error,share,num1,num2,num3,p.fit,false.final,share.final,incentive,share.final.A,cons,stringsAsFactors=FALSE)
was4d<-rbind(was4d,a)
}

TFTR<-ifelse(was4d$num1<was4d$num2 & was4d$num2<was4d$num3 & was4d$num1%%2==0 & (was4d$num2-was4d$num1)==2 & (was4d$num3-was4d$num2)==2 & was4d$num1>=2 & was4d$num3<=100,1,0)
TFTR.A<-ifelse(was4d$num1<was4d$num2 & was4d$num2<was4d$num3 & was4d$num1%%2==0 & (was4d$num2-was4d$num1)==2 & (was4d$num3-was4d$num2)==2 & was4d$num1>2 & was4d$num3<100,1,0)
was4d<-cbind(was4d,TFTR)
was4d<-cbind(was4d,TFTR.A)
actual.error<-ifelse((was4d$TFTR==1 & was4d$feedback==2) | (was4d$TFTR==0 & was4d$feedback==1),1,0)
actual.error.A<-ifelse((was4d$TFTR.A==1 & was4d$feedback==2) | (was4d$TFTR.A==0 & was4d$feedback==1),1,0)
was4d<-cbind(was4d,actual.error)
was4d<-cbind(was4d,actual.error.A)
##During task error attributions:1=True; 2=False##
##During task sharing: 1=Yes; 2=No##
##Final error attributions:1=False;2=True##
##Final Sharing:1=Share; 2=dont share####
was4d$error.should<-ifelse(is.na(was4d$feedback)==TRUE,NA,0)
was4d$error.should[was4d$feedback==2 & was4d$p.fit>80]<-1
was4d$error.should[was4d$feedback==1 & was4d$p.fit<20]<-1
was4d$error.should[was4d$feedback==2 & was4d$p.fit==80]<-NA
was4d$error.should[was4d$feedback==1 & was4d$p.fit==20]<-NA

was4d$cons.tp<-ifelse(was4d$error.should==1 & was4d$error==1,1,0)
was4d$cons.tn<-ifelse(was4d$error.should==0 & was4d$error==0,1,0)
was4d$cons.fp<-ifelse(was4d$error.should==0 & was4d$error==1,1,0)
was4d$cons.fn<-ifelse(was4d$error.should==1 & was4d$error==0,1,0)

was4d$subjectid<-as.numeric(was4d$name)
was4d$falsification<-was4d$feedback-1
was4d$error<-was4d$error-1
was4d$share<-was4d$share%%2
was4d$incentivef<-as.factor(was4d$incentive)
was4d$incentive<-as.factor(was4d$incentive)
levels(was4d$incentive)<-c(0,1)

#unique.id<-was4.t[,c("V1289","V1")]
#qqq<-levels(unique.id$V1)
#for(i in 1:length(qqq)){
#was4d$unique.id[was4d$name==qqq[i]]<-as.character(unique.id$V1075[unique.id$V1==qqq[i]])

##Control: Nested Boostrap##
chip<-c()
phip<-c()
phi.p<-c()
chip.final<-c()
phip.final<-c()
phi.p.final<-c()
glmeraa<-c()
glmerff<-c()
glmeraa.final<-c()
glmerff.final<-c()
glmershnerr<-c()
glmersherr<-c()
glmershnerr.final<-c()
glmersherr.final<-c()
glmersha<-c()
glmershf<-c()
tfals<-c()
tfals.final<-c()
tsh<-c()
tsherr<-c()
tsherr.final<-c()
icc.shatt.final<-c()
icc.shatt<-c()
icc.shfee<-c()
glmershatt.final.chi<-c()
glmershatt.final.chip<-c()
glmershfee.chi<-c()
glmershfee.chip<-c()
glmershatt.chi<-c()
glmershatt.chip<-c()
qf<-was4d
##For each observation in the dataset make a zero##
qf$new.id<-c(rep(0,length(qf$subjectid)))
for(i in 1:n3){
##obtain the id numbers of subjects we want##
a<-as.numeric(levels(as.factor(as.character(qf$subjectid[qf$incentive==0]))))
##Sort a sample from these subjects##
a<-sort(sample(a,size=length(a),replace=TRUE))
##Make some new IDs for the bootstrap sample##
new.id<-seq(length(a))
##Make a data frame holding the old and new ID numbers##
a<-cbind(a,new.id)
a<-data.frame(a)
q1<-data.frame()
####
##For each ID number##
for(j in 1:length(a[,2])){
##The participant with subjectID equal to the jth ID number gets a new id numer equal to j##
  qf$new.id[qf$subjectid==a$a[j]]<-j
  ##Add this new participant to the bootstrapped sample##
q1<-rbind(q1,qf[qf$subjectid==a$a[j],])
} 
glmerfals<-glmer(error~falsification+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmeraa[i]<-invlogit(fixef(glmerfals)[1])
glmerff[i]<-invlogit(fixef(glmerfals)[1]+fixef(glmerfals)[2])
tfals[i]<-fixef(glmerfals)[2]/sqrt(diag(vcov(glmerfals))[2])

glmerfals.final<-glmer(false.final~falsification+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmeraa.final[i]<-invlogit(fixef(glmerfals.final)[1])
glmerff.final[i]<-invlogit(fixef(glmerfals.final)[1]+fixef(glmerfals.final)[2])
tfals.final[i]<-fixef(glmerfals.final)[2]/sqrt(diag(vcov(glmerfals.final))[2])

glmerphi<-glmer(actual.error~error+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip[i]<-nova$Chisq[2]
phip[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1[q1$incentive==0,]$error)))
phi.p[i]<-nova[2,7]

glmerphi<-glmer(actual.error~false.final+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.final[i]<-nova$Chisq[2]
phip.final[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1[q1$incentive==0,]$false.final)))
phi.p.final[i]<-nova[2,7]

glmershfee<-glmer(share~falsification+(falsification|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershfee.int<-glmer(share~falsification+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmersha[i]<-invlogit(fixef(glmershfee.int)[1])
glmershf[i]<-invlogit(fixef(glmershfee.int)[1]+fixef(glmershfee.int)[2])
glmershfee.anova<-anova(glmershfee,glmershfee.int)
glmershfee.chi[i]<-glmershfee.anova$Chisq[2]
glmershfee.chip[i]<-glmershfee.anova[2,7]
lmershfee<-lmer(share~falsification+(falsification|new.id),data=q1[q1$incentive==0,])
icc.shfee[i]<-(as.numeric(summary(lmershfee)@REmat[,4][2]))/(as.numeric(summary(lmershfee)@REmat[,4][1])+as.numeric(summary(lmershfee)@REmat[,4][2])+as.numeric(summary(lmershfee)@REmat[,4][3]))
tsh[i]<-abs(fixef(glmershfee)[2]/sqrt(diag(vcov(glmershfee))[2]))

glmershatt<-glmer(share~error+(error|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershatt.int<-glmer(share~error+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershnerr[i]<-invlogit(fixef(glmershatt.int)[1])
glmersherr[i]<-invlogit(fixef(glmershatt.int)[1]+fixef(glmershatt.int)[2])
glmershatt.anova<-anova(glmershatt,glmershatt.int)
glmershatt.chi[i]<-glmershatt.anova$Chisq[2]
glmershatt.chip[i]<-glmershatt.anova[2,7]
lmershatt<-lmer(share~error+(error|new.id),data=q1[q1$incentive==0,])
icc.shatt[i]<-(as.numeric(summary(lmershatt)@REmat[,4][2]))/(as.numeric(summary(lmershatt)@REmat[,4][1])+as.numeric(summary(lmershatt)@REmat[,4][2])+as.numeric(summary(lmershatt)@REmat[,4][3]))
tsherr[i]<-abs(fixef(glmershatt)[2]/sqrt(diag(vcov(glmershatt))[2]))

glmershatt.final<-glmer(share.final~false.final+(false.final|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershatt.final.int<-glmer(share.final~false.final+(1|new.id),data=q1[q1$incentive==0,],family=binomial(link="logit"))
glmershnerr.final[i]<-invlogit(fixef(glmershatt.final.int)[1])
glmersherr.final[i]<-invlogit(fixef(glmershatt.final.int)[1]+fixef(glmershatt.final.int)[2])
glmershatt.final.anova<-anova(glmershatt.final,glmershatt.final.int)
glmershatt.final.chi[i]<-glmershatt.final.anova$Chisq[2]
glmershatt.final.chip[i]<-glmershatt.final.anova[2,7]
lmershatt.final<-lmer(share.final~false.final+(false.final|new.id),data=q1[q1$incentive==0,])
icc.shatt.final[i]<-(as.numeric(summary(lmershatt.final)@REmat[,4][2]))/(as.numeric(summary(lmershatt.final)@REmat[,4][1])+as.numeric(summary(lmershatt.final)@REmat[,4][2])+as.numeric(summary(lmershatt.final)@REmat[,4][3]))
tsherr.final[i]<-abs(fixef(glmershatt.final)[2]/sqrt(diag(vcov(glmershatt.final))[2]))
}
glmeraa.se<-sd(glmeraa)
glmerff.se<-sd(glmerff)
glmeraa.se.final<-sd(glmeraa.final)
glmerff.se.final<-sd(glmerff.final)
glmershf.se<-sd(glmershf)
glmersha.se<-sd(glmersha)
glmershnerr.se<-sd(glmershnerr)
glmersherr.se<-sd(glmersherr)
glmershnerr.se.final<-sd(glmershnerr.final)
glmersherr.se.final<-sd(glmersherr.final)
####
####Incentive Nested Boostrap##
chip.i<-c()
phip.i<-c()
phi.p.i<-c()
chip.i.final<-c()
phip.i.final<-c()
phi.p.i.final<-c()
glmeraa.i<-c()
glmerff.i<-c()
glmeraa.final.i<-c()
glmerff.final.i<-c()
glmershnerr.i<-c()
glmersherr.i<-c()
glmershnerr.final.i<-c()
glmersherr.final.i<-c()
glmshnerr.final.i<-c()
glmsherr.final.i<-c()
glmersha.i<-c()
glmershf.i<-c()
tfals.i<-c()
tfals.final.i<-c()
tsh.i<-c()
tsherr.i<-c()
tsherr.final.i<-c()
icc.shatt.i<-c()
icc.shfee.i<-c()
icc.shatt.final.i<-c()
glmershatt.final.i.chi<-c()
glmershatt.final.i.chip<-c()
glmershatt.i.chi<-c()
glmershatt.i.chip<-c()
glmershfee.i.chi<-c()
glmershfee.i.chip<-c()
qf<-was4d
##For each observation in the dataset make a zero##
qf$new.id<-c(rep(0,length(qf$subjectid)))
for(i in 1:n3){
a<-as.numeric(levels(as.factor(as.character(qf$subjectid[qf$incentive==1]))))
##Sort a sample from these subjects##
a<-sort(sample(a,size=length(a),replace=TRUE))
##Make some new IDs for the bootstrap sample##
new.id<-seq(length(a))
##Make a data frame holding the old and new ID numbers##
a<-cbind(a,new.id)
a<-data.frame(a)
q1<-data.frame()
####
##For each ID number##
for(j in 1:length(a[,2])){
##The participant with subjectID equal to the jth ID number gets a new id numer equal to j##
  qf$new.id[qf$subjectid==a$a[j]]<-j
  ##Add this new participant to the bootstrapped sample##
q1<-rbind(q1,qf[qf$subjectid==a$a[j],])
} 

glmerfals.i<-glmer(error~falsification+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmeraa.i[i]<-invlogit(fixef(glmerfals.i)[1])
glmerff.i[i]<-invlogit(fixef(glmerfals.i)[1]+fixef(glmerfals.i)[2])
tfals.i[i]<-fixef(glmerfals.i)[2]/sqrt(diag(vcov(glmerfals.i))[2])

glmerfals.final.i<-glmer(false.final~falsification+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmeraa.final.i[i]<-invlogit(fixef(glmerfals.final.i)[1])
glmerff.final.i[i]<-invlogit(fixef(glmerfals.final.i)[1]+fixef(glmerfals.final.i)[2])
tfals.final.i[i]<-fixef(glmerfals.final.i)[2]/sqrt(diag(vcov(glmerfals.final.i))[2])

glmerphi<-glmer(actual.error~error+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.i[i]<-nova$Chisq[2]
phip.i[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1[q1$incentive==1,]$error)))
phi.p.i[i]<-nova[2,7]

glmerphi<-glmer(actual.error~false.final+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmerphi.null<-glmer(actual.error~(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
nova<-anova(glmerphi.null,glmerphi)
chip.i.final[i]<-nova$Chisq[2]
phip.i.final[i]<-sqrt(nova$Chisq[2]/length(na.omit(q1[q1$incentive==1,]$false.final)))
phi.p.i.final[i]<-nova[2,7]

glmershfee.i<-glmer(share~falsification+(falsification|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershfee.i.int<-glmer(share~falsification+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmersha.i[i]<-invlogit(fixef(glmershfee.i.int)[1])
glmershf.i[i]<-invlogit(fixef(glmershfee.i.int)[1]+fixef(glmershfee.i.int)[2])
glmershfee.i.anova<-anova(glmershfee.i,glmershfee.i.int)
glmershfee.i.chi[i]<-glmershfee.i.anova$Chisq[2]
glmershfee.i.chip[i]<-glmershfee.i.anova[2,7]
lmershfee.i<-lmer(share~falsification+(falsification|new.id),data=q1[q1$incentive==1,])
icc.shfee.i[i]<-(as.numeric(summary(lmershfee.i)@REmat[,4][2]))/(as.numeric(summary(lmershfee.i)@REmat[,4][1])+as.numeric(summary(lmershfee.i)@REmat[,4][2])+as.numeric(summary(lmershfee.i)@REmat[,4][3]))
tsh.i[i]<-abs(fixef(glmershfee.i)[2]/sqrt(diag(vcov(glmershfee.i))[2]))

glmershatt.i<-glmer(share~error+(error|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershatt.i.int<-glmer(share~error+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershnerr.i[i]<-invlogit(fixef(glmershatt.i.int)[1])
glmersherr.i[i]<-invlogit(fixef(glmershatt.i.int)[1]+fixef(glmershatt.i.int)[2])
glmershatt.i.anova<-anova(glmershatt.i,glmershatt.i.int)
glmershatt.i.chi[i]<-glmershatt.i.anova$Chisq[2]
glmershatt.i.chip[i]<-glmershatt.i.anova[2,7]
lmershatt.i<-lmer(share~error+(error|new.id),data=q1[q1$incentive==1,])
icc.shatt.i[i]<-(as.numeric(summary(lmershatt.i)@REmat[,4][2]))/(as.numeric(summary(lmershatt.i)@REmat[,4][1])+as.numeric(summary(lmershatt.i)@REmat[,4][2])+as.numeric(summary(lmershatt.i)@REmat[,4][3]))
tsherr.i[i]<-abs(fixef(glmershatt.i)[2]/sqrt(diag(vcov(glmershatt.i))[2]))

glmershatt.final.i<-glmer(share.final~false.final+(false.final|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershatt.final.i.int<-glmer(share.final~false.final+(1|new.id),data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmershatt.final.i.anova<-anova(glmershatt.final.i,glmershatt.final.i.int)
glmershatt.final.i.chi[i]<-glmershatt.final.i.anova$Chisq[2]
glmershatt.final.i.chip[i]<-glmershatt.final.i.anova[2,7]
glmershnerr.final.i[i]<-invlogit(fixef(glmershatt.final.i.int)[1])
glmersherr.final.i[i]<-invlogit(fixef(glmershatt.final.i.int)[1]+fixef(glmershatt.final.i.int)[2])

tsherr.final.i[i]<-abs(fixef(glmershatt.final.i.int)[2]/sqrt(diag(vcov(glmershatt.final.i.int))[2]))
glmshatt.final.i<-glm(share.final~false.final,data=q1[q1$incentive==1,],family=binomial(link="logit"))
glmshnerr.final.i[i]<-invlogit(coef(glmshatt.final.i)[1])
glmsherr.final.i[i]<-invlogit(coef(glmshatt.final.i)[1]+coef(glmshatt.final.i)[2])

lmershatt.final.i<-lmer(share.final~false.final+(false.final|new.id),data=q1[q1$incentive==1,])
icc.shatt.final.i[i]<-(as.numeric(summary(lmershatt.final.i)@REmat[,4][2]))/(as.numeric(summary(lmershatt.final.i)@REmat[,4][1])+as.numeric(summary(lmershatt.final.i)@REmat[,4][2])+as.numeric(summary(lmershatt.final.i)@REmat[,4][3]))
}

glmeraa.se.i<-sd(glmeraa.i)
glmerff.se.i<-sd(glmerff.i)
glmeraa.se.final.i<-sd(glmeraa.final.i)
glmerff.se.final.i<-sd(glmerff.final.i)
glmershf.se.i<-sd(glmershf.i)
glmersha.se.i<-sd(glmersha.i)
glmershnerr.se.i<-sd(glmershnerr.i)
glmersherr.se.i<-sd(glmersherr.i)
glmershnerr.se.final.i<-sd(glmershnerr.final.i)
glmersherr.se.final.i<-sd(glmersherr.final.i)
glmsherr.se.final.i<-sd(glmsherr.final.i)

####
##Control: Hierarchical linear model for correlation between prior (P(TFTR)) and error attribution##
glmer.ov<-glmer(error.should~error+(1|subjectid),data=was4d[was4d$incentive==0,],family=binomial(link="logit"))
glmer.ov.null<-glmer(error.should~(1|subjectid),data=was4d[was4d$incentive==0,],family=binomial(link="logit"))
nova.ov<-anova(glmer.ov.null,glmer.ov)
chi.ov<-nova.ov$Chisq[2]
phi.ov<-sqrt(chi.ov/length(na.omit(was4d$actual.error[was4d$incentive==0])))
####
##As a check: phi at the participant level for people who it could be calculated###
cons.chi<-c()
cons.denom<-c()
cons.phi<-c()
for(i in levels(as.factor(as.character(was4d$subjectid)))){
cons.chi[i]<-sum(na.omit(was4d$cons.tp[was4d$subjectid==i]))*sum(na.omit(was4d$cons.tn[was4d$subjectid==i]))-sum(na.omit(was4d$cons.fp[was4d$subjectid==i]))*sum(na.omit(was4d$cons.fn[was4d$subjectid==i]))
cons.denom[i]<-sqrt((sum(na.omit(was4d$cons.tp[was4d$subjectid==i]))+sum(na.omit(was4d$cons.fp[was4d$subjectid==i])))*(sum(na.omit(was4d$cons.fn[was4d$subjectid==i]))+sum(na.omit(was4d$cons.tn[was4d$subjectid==i])))*(sum(na.omit(was4d$cons.fp[was4d$subjectid==i]))+sum(na.omit(was4d$cons.tn[was4d$subjectid==i])))*(sum(na.omit(was4d$cons.tp[was4d$subjectid==i]))+sum(na.omit(was4d$cons.fn[was4d$subjectid==i]))))
cons.phi[i]<-cons.chi[i]/cons.denom[i]
}
####
##Incentive: Hierarchical linear model for correlation between prior (P(TFTR)) and error attribution##

glmer.ov.i<-glmer(error.should~error+(1|subjectid),data=was4d[was4d$incentive==1,],family=binomial(link="logit"))
glmer.ov.null.i<-glmer(error.should~(1|subjectid),data=was4d[was4d$incentive==1,],family=binomial(link="logit"))
nova.ov.i<-anova(glmer.ov.null.i,glmer.ov.i)
chi.ov.i<-nova.ov.i$Chisq[2]
phi.ov.i<-sqrt(chi.ov.i/length(na.omit(was4d$actual.error[was4d$incentive==1])))

####
##Trials##
was4d$complete<-ifelse(is.na(was4d$feedback)==FALSE,1,0)
trials<-c()
incentive<-c()
for(i in 1:length(levels(as.factor(was4d$subjectid)))){
trials[i]<-sum(was3d$complete[was4d$subjectid==i])
incentive[i]<-was3d$incentive[was4d$subjectid==i][1]
}
trialsd<-data.frame(cbind(trials,incentive))
trial.test<-t.test(trialsd$trials~trialsd$incentive)
###
##Final Sharing##
glmershatt.final.A<-glmer(abs(share.final-share.final.A)~incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
glmershatt.final.A<-glmer(abs(share.final-share.final.A)~incentive+(incentive|subjectid),data=was4d,family=binomial(link="logit"))

glmershatt.final.i.anova<-anova(glmershatt.final.i,glmershatt.final.i.int)
glmershatt.final.i.chi[i]<-glmershatt.final.i.anova$Chisq[2]
glmershatt.final.i.chip[i]<-glmershatt.final.i.anova[2,7]
glmershnerr.final.i[i]<-invlogit(fixef(glmershatt.final.i.int)[1])
glmersherr.final.i[i]<-invlogit(fixef(glmershatt.final.i.int)[1]+fixef(glmershatt.final.i.int)[2])

glmerfals.final.Qf<-glmer(false.final~falsification*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
tfals.final.int<-fixef(glmerfals.final.Qf)[4]/sqrt(diag(vcov(glmerfals.final.Qf))[4])

glmer.bayes.int<-glmer(error.should~error*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
bayes.t<-fixef(glmer.bayes.int)[3]/sqrt(diag(vcov(glmer.bayes.int))[3])

qarkl<-glmer(share~falsification*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
qarkl.e<-glmer(share~error*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
qarkl.ef<-glmer(share.final~false.final*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
glmershatt.final.x<-glmer(share.final~false.final+(false.final|subjectid),data=was4d,family=binomial(link="logit"))
glmershatt.final.x.d<-glmer(share.final~false.final+(1|subjectid),data=was4d,family=binomial(link="logit"))
glmershatt.final.x.anova<-anova(glmershatt.final.x,glmershatt.final.x.d)
glmershatt.final.x.chi<-glmershatt.final.x.anova$Chisq[2]
glmershatt.final.x.chip<-glmershatt.final.x.anova[2,7]

false.final.glmer<-glmer(false.final~actual.error*falsification*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
false.final.glmer.x<-glmer(false.final~actual.error*falsification+(1|subjectid),data=was4d[was4d$incentive==0,],family=binomial(link="logit"))
false.final.glmer.i<-glmer(false.final~actual.error*falsification+(1|subjectid),data=was4d[was4d$incentive==1,],family=binomial(link="logit"))
@ 

\subsubsection{Participants}  
One hundred twenty three Amazon Mturk volunteers completed the task for \$5. There were \Sexpr{length(na.omit(was4$gender[was4$gender==2]))} women, with an average age of \Sexpr{prettyNum(mean(was3$age,na.rm=TRUE))} years (range: \Sexpr{min(was4$age[was4$age!=2],na.rm=TRUE)}--\Sexpr{max(was4$age,na.rm=TRUE)}).

\subsubsection{Design}
The design was a 2 level (perverse or compatible incentive) between-subjects design.

\subsubsection{Materials}
The procedure and materials were the same as in Experiment Three except for the following modifications.  All mentions of `sharing' were changed to `communication'.  The data sharing task was described as follows:

\begin{quote}
``For each trial you communicate, another person will get only the triple you proposed and the feedback you received, nothing else.

The person will also receive the Final Answer you propose at the end of the task, regardless of the trials you communicate.  However, this person will only know about the trials you communicate, and does not know how many trials you completed or that you did not have to communicate all of your trials.''
\end{quote}

\begin{flusleft}
All data-sharing judgments were changed to the following wording:
\end{flushleft}

\begin{quote}
Do you think this trial should be communicated?
\end{quote}

Finally, participants were given the Actual Rule after they gave their final answer, and were allowed to change their data sharing judgments.

\begin{quote}
``In words, the actual rule is ascending consecutive even numbers from 2-100. \\
In math, the actual rule is:
\begin{itemize}
  \item There are three numbers, call them num1, num2, num3, in order. 
  \item $num2 - num1 = 2$
  \item $num3 - num2 = 2$
  \item $num1 is even$
  \item $num1 > 2$
  \item $num3 < 100$
\end{itemize}
If you want, you can now decide to change the trials that you communicate below.'' \footnote{The last two constraints should also include an equal to.  This may have confused participants.  However, alternative analyses taking these differences into accounts did not change the results substantially.}
\end{quote}

\subsection{Results}
%\subsubsection{Incentives and Performance}
%As in Experiment Three, participants in the compatible and perverse incentive conditions completed a median of about \Sexpr{prettyNum(median(trialsd$trials,na.rm=TRUE))} trials (\Sexpr{prettyNum(median(trialsd$trials[trialsd$incentive==1],na.rm=TRUE))} and \Sexpr{prettyNum(median(trialsd$trials[trialsd$incentive==2],na.rm=TRUE))}, respectively), $t(xx)=$ \Sexpr{prettyNum(trial.test$statistic)}, $p=$ \Sexpr{prettyNum(ptrunc(trial.test$p.value))}, $d=$ \Sexpr{prettyNum(trial.test$statistic/sqrt(99))}.%$  

\subsubsection{Attributions to Error}

There were main effects of both actual error ($t(1365)=$ \Sexpr{prettyNum(fixef(false.final.glmer)[2]/sqrt(diag(vcov(false.final.glmer))[2]))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(false.final.glmer)[2]/sqrt(diag(vcov(false.final.glmer))[2]),1365)))}), and feedback ($t(1365)=$ \Sexpr{prettyNum(fixef(false.final.glmer)[3]/sqrt(diag(vcov(false.final.glmer))[3]))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(false.final.glmer)[3]/sqrt(diag(vcov(false.final.glmer))[3]),1365)))}), on attributions to error, with an interaction between actual error and incentive, such that actual error had less of an influence on attributions to error in the perverse incentive condition than compatible incentive condition ($t(1365)=$ \Sexpr{prettyNum(abs(fixef(false.final.glmer)[6]/sqrt(diag(vcov(false.final.glmer))[6])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(false.final.glmer)[6]/sqrt(diag(vcov(false.final.glmer))[6]),1365)))}).  For attributions at the end of the task, those in the perverse incentive condition attributed affirming feedback to error less than those in the compatible incentive condition (\Sexpr{prettyNum(100*mean(glmeraa.final.i))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa.final))}\%), but the reverse was true for disconfirming feedback (\Sexpr{prettyNum(100*mean(glmerff.final.i))}\% vs. \Sexpr{prettyNum(100*mean(glmerff.final))}\%), ($t(1369)=$ \Sexpr{prettyNum(mean(tfals.final.int))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals.final.int),1369)))}, \emph{d} = \Sexpr{prettyNum(mean(tfals.final.int)/sqrt(1369))}).

%Both during (\Sexpr{prettyNum(100*mean(glmerff))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa))}\%) and at the end of the task (\Sexpr{prettyNum(100*mean(glmerff.final))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa.final))}\%), those in the compatible incentive condition were more likely to see feedback as in error when it was disconfirming than when it was affirming, ($t(714)=$ \Sexpr{prettyNum(mean(tfals))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals),714)))}, $d=$ \Sexpr{prettyNum(mean(tfals)/sqrt(714))}; $t(724)=$ \Sexpr{prettyNum(mean(tfals.final))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals.final),724)))}, $d=$ \Sexpr{prettyNum(mean(tfals.final)/sqrt(724))}, respectively).  Similarly, both during (\Sexpr{prettyNum(100*mean(glmerff.i))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa.i))}\%) and at the end of the task (\Sexpr{prettyNum(100*mean(glmerff.final.i))}\% vs. \Sexpr{prettyNum(100*mean(glmeraa.final.i))}\%), those in the perverse incentive condition were significantly more likely to see feedback as in error when it was disconfirming than when it was affirming ($t(599)=$ \Sexpr{prettyNum(mean(tfals.i))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals.i),599)))}, \emph{d} = \Sexpr{prettyNum(mean(tfals.i)/sqrt(599))}; $t(645)=$ \Sexpr{prettyNum(mean(tfals.final.i))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tfals.final.i),645)*2))}, $d=$ \Sexpr{prettyNum(mean(tfals.final.i)/sqrt(645))}, respectively).  

\subsubsection{Bayesian Consistency}

For the compatible condition, the overall correlation between their attributions to error and the consistency criterion was $\phi=$ \Sexpr{prettyNum(phi.ov)}, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi.ov)}, $p<$ \Sexpr{prettyNum(ptrunc(dchisq(chi.ov,1)))}.  Participants in the perverse incentive condition exhibited similar consistency, $\phi=$ \Sexpr{prettyNum(phi.ov.i)}, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi.ov.i)}, $p<$ \Sexpr{prettyNum(ptrunc(dchisq(chi.ov.i,1)))}.

%\footnote{There was also a main effect of perverse incentive, where they were slightly less consistent than those in the compatible group ($t(1263)=$ \Sexpr{prettyNum(abs(bayes.t))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(abs(bayes.t),1267)))}, \emph{d} = \Sexpr{prettyNum(abs(bayes.t)/sqrt(1267))}.  For affirming feedback in the compatible condition, they correctly attributed \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$falsification==0 & was4d$p.fit<0.2 & was4d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was4d$error[was4d$falsification==0 & was4d$p.fit<0.2 & was4d$incentive==0])))} trials to error, and incorrectly attributed \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$falsification==0 & was4d$p.fit>0.2 & was4d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was4d$error[was4d$falsification==0 & was4d$p.fit>0.2 & was4d$incentive==0])))} trials to error, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi2a)}, $p<$ \Sexpr{prettyNum(ptrunc(dchisq(chi2a,1)*2))}, $\phi=$ \Sexpr{prettyNum(phia)}.  For disconfirming feedback they correctly attributed \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$falsification==1 & was4d$p.fit>0.8 & was4d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was4d$error[was4d$falsification==1 & was4d$p.fit>0.8 & was4d$incentive==0])))} trials to error, and incorrectly attributed \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$falsification==1 & was4d$p.fit<0.8 & was4d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was4d$error[was4d$falsification==1 & was4d$p.fit<0.8 & was4d$incentive==0])))} trials to error, $\chi^{2}(1)=$ \Sexpr{prettyNum(chi2f)}, $p<0.05$, $\phi=$ \Sexpr{prettyNum(phif)}.  For affirming feedback in the perverse condition, they correctly attributed \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$falsification==0 & was4d$p.fit<0.2 & was4d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$error[was4d$falsification==0 & was4d$p.fit<0.2 & was4d$incentive==1])))} trials to error, and incorrectly attributed \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$falsification==0 & was4d$p.fit>0.2 & was4d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$error[was4d$falsification==0 & was4d$p.fit>0.2 & was4d$incentive==1])))} trials to error, $\chi^{2}(1)=$ \Sexpr{prettyNum(affchip.i)}, $p=$ \Sexpr{prettyNum(ptrunc(affphi.p.i))}, $\phi=$ \Sexpr{prettyNum(affphip.i)}.  For disconfirming feedback they attributed \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$falsification==1 & was4d$p.fit>0.8 & was4d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$error[was4d$falsification==1 & was4d$p.fit>0.8 & was4d$incentive==1])))} trials to error correctly, and incorrectly attributed \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$falsification==1 & was4d$p.fit<0.8 & was4d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$error[was4d$falsification==1 & was4d$p.fit<0.8 & was4d$incentive==1])))} trials to error, $\chi^{2}(1) = \Sexpr{prettyNum(discchip.i)}$, $p<0.05$, $\phi=$ \Sexpr{prettyNum(discphip.i)}.} 

\subsubsection{Accuracy}
Participants both in the compatible and perverse incentive conditions were able to accurately identify error during the task ($\chi^{2}(1) = \Sexpr{prettyNum(mean(chip))}$, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p)))}, $\phi = \Sexpr{prettyNum(mean(phip))}$; $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(chip.i))}, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p.i)))}, $\phi=$ \Sexpr{prettyNum(mean(phip.i))}, respectively).

%\footnote{Participants in the compatible incentive group correctly identified \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$actual.error==1 & was4d$incentive==0])))} of \Sexpr{prettyNum(sum(na.omit(was4d$actual.error[was4d$incentive==0])))} actual errors and incorrectly identified \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$actual.error==0 & was4d$incentive==0])))} of \Sexpr{prettyNum(length(na.omit(was4d$feedback[was4d$actual.error==0 & was4d$incentive==0])))} non-errors as error.  For the perverse incentive condition, participants correctly identified \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$actual.error==1 & was4d$incentive==1])))} of \Sexpr{prettyNum(sum(na.omit(was4d$actual.error[was4d$incentive==1])))} actual errors and incorrectly identified \Sexpr{prettyNum(sum(na.omit(was4d$error[was4d$actual.error==0 & was4d$incentive==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$feedback[was4d$actual.error==0 & was4d$incentive==1])))} non-errors as error.  This accuracy also slightly improved in judgments made at the end of the task for the compatible but not perverse incentive condition ($\chi^{2}(1) = \Sexpr{prettyNum(mean(chip.final))}$, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p.final)))}, $\phi = \Sexpr{prettyNum(mean(phip.final))}$; $\chi^{2}(1) = \Sexpr{prettyNum(mean(chip.i.final))}$, $p<$ \Sexpr{prettyNum(ptrunc(mean(phi.p.i.final)))}, $\phi = \Sexpr{prettyNum(mean(phip.i.final))}$, respectively).}

\subsubsection{Data Sharing}

Participants in the compatible and perverse incentive conditions shared trials at similar rates.  They shared fewer trials (\Sexpr{prettyNum(100*mean(glmershf))}\% vs. \Sexpr{prettyNum(100*mean(glmershf.i))}\%) when the feedback was disconfirming than affirming (\Sexpr{prettyNum(100*mean(glmersha))}\% vs. \Sexpr{prettyNum(100*mean(glmersha.i))}\%), a main effect of feedback only ($t(1072)$ = \Sexpr{prettyNum(abs(fixef(qarkl)[2]/sqrt(diag(vcov(qarkl))[2])))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(qarkl)[2]/sqrt(diag(vcov(qarkl))[2]),1072)))}, $\emph{d} = \Sexpr{prettyNum(abs(fixef(qarkl)[2]/sqrt(diag(vcov(qarkl))[2])/sqrt(1076)))}$), and no other main effects or interactions.  During the task they shared fewer trials that they attributed to error (\Sexpr{prettyNum(100*mean(glmersherr))}\% vs. \Sexpr{prettyNum(100*mean(glmersherr.i))}\%) than they saw as accurate (\Sexpr{prettyNum(100*mean(glmershnerr))}\% vs. \Sexpr{prettyNum(100*mean(glmershnerr.i))}\%) a main effect of attribution only ($t(1073)$ = \Sexpr{prettyNum(abs(fixef(qarkl.e)[2]/sqrt(diag(vcov(qarkl.e))[2])))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(qarkl.e)[2]/sqrt(diag(vcov(qarkl.e))[2]),1073)))}, $\emph{d} = \Sexpr{prettyNum(abs(fixef(qarkl.e)[2]/sqrt(diag(vcov(qarkl.e))[2])/sqrt(1077)))}$), and no other main effects or interactions.  At the end of the task they shared fewer trials that they attributed to error (\Sexpr{prettyNum(100*mean(glmersherr.final,na.rm=TRUE))}\% vs. \Sexpr{prettyNum(100*mean(glmersherr.final.i,na.rm=TRUE))}\%) than trials they saw as accurate (\Sexpr{prettyNum(100*mean(glmershnerr.final,na.rm=TRUE))}\% vs. \Sexpr{prettyNum(100*mean(glmershnerr.final.i,na.rm=TRUE))}\%) a main effect of attribution only ($t(1478)$ = \Sexpr{prettyNum(abs(fixef(qarkl.ef)[2]/sqrt(diag(vcov(qarkl.ef))[2])))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(qarkl.ef)[2]/sqrt(diag(vcov(qarkl.ef))[2]),1478)))}, $\emph{d} = \Sexpr{prettyNum(abs(fixef(qarkl.ef)[2]/sqrt(diag(vcov(qarkl.ef))[2])/sqrt(1482)))}$), and no other main effects or interactions.  Both conditions also exhibited the bimodal sharing pattern as in Experiment Three, with some participants sharing all data attributed to error at the end of the task, and others sharing none ($\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.final.x.chi))}, $p<$ \Sexpr{prettyNum(ptrunc(median(glmershatt.final.x.chip)))}), and no interaction with incentive condition.

%As seen in Figure~\ref{fig:was4fighist}, 

%of trials when they attributed feedback to error and \Sexpr{prettyNum(100*mean(glmershnerr))}\%, ($SE=$ \Sexpr{prettyNum(100*glmershnerr.se)}\%) of trials when they judged it to be accurate during the task; and 

 %($SE=$ \Sexpr{prettyNum(100*glmersherr.se.final)}\%) of trials that they judged to be an error and \Sexpr{prettyNum(100*mean(glmershnerr.final,na.rm=TRUE))}\%, ($SE=$ \Sexpr{prettyNum(100*glmershnerr.se.final)}\%) of trials when they judged it to be accurate at the end of the task ($t(588)$ = \Sexpr{prettyNum(mean(tsh))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsh),588)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsh)/sqrt(590))}$; $t(590)$ = \Sexpr{prettyNum(mean(tsherr))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr),590)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr)/sqrt(592))}$; $t(853)$ = \Sexpr{prettyNum(mean(tsherr.final))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.final),853)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr.final)/sqrt(855))}$, respectively).  They also exhibited the bimodal sharing pattern as in Experiment Three, with some participants sharing all data attributed to error at the end of the task, and others sharing none $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.final.chi))}, $p<$ \Sexpr{prettyNum(ptrunc(median(glmershatt.final.chip)))}.  

%($SE=$ \Sexpr{prettyNum(100*glmershf.se)}\%)
%($SE=$ \Sexpr{prettyNum(100*glmersha.se)}\%)
%($SE=$ \Sexpr{prettyNum(100*glmersherr.se)}\%)
 
%Participants in the perverse incentive condition shared at similar rates to those in the compatible incentive condition.  They shared (\Sexpr{prettyNum(100*mean(glmershf.i))}\%, SE = \Sexpr{prettyNum(100*glmershf.se.i)}\%)$ trials when the feedback was disconfirming and $(\Sexpr{prettyNum(100*mean(glmersha.i))}\%, SE = \Sexpr{prettyNum(100*glmersha.se.i)}\%)$ trials when it was affirming; 

%$(\Sexpr{prettyNum(100*mean(glmersherr.i))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se.i)}\%)$ trials when they judged the feedback to be an error during the task and $(\Sexpr{prettyNum(100*mean(glmershnerr.i))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se.i)}\%)$ trials when they judged the feedback to be accurate during the task; and $(\Sexpr{prettyNum(100*mean(glmersherr.final.i,na.rm=TRUE))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se.final.i)}\%)$ trials that they judged to be an error and $(\Sexpr{prettyNum(100*mean(glmershnerr.final.i,na.rm=TRUE))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se.final.i)}\%)$ trials that they judged to be accurate at the end of the task ($t(484)$ = \Sexpr{prettyNum(mean(tsh.i))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsh.i),484)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsh.i)/sqrt(486))}$; $t(483)$ = \Sexpr{prettyNum(mean(tsherr.i))}, \emph{p} $<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.i),483)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr.i)/sqrt(485))}$; and $t(625)$ = \Sexpr{prettyNum(mean(tsherr.final.i))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.final.i),625)))}, $d=$ \Sexpr{prettyNum(mean(tsherr.final.i)/sqrt(627))}, respectively).  Similar to those in the compatible incentive condition, they exhibited the bimodal sharing pattern as in Experiment Three, with some participants sharing all data attributed to error at the end of the task, and others sharing none $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.final.i.chi,na.rm=TRUE))}, $p<$ \Sexpr{prettyNum(ptrunc(median(glmershatt.final.i.chip,na.rm=TRUE)))}.

%\footnote{Participants in the compatible incentive condition shared \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$falsification==1 & was4d$incentive==0 & was4d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$falsification==1 & was4d$incentive==0])))} trials when the feedback was disconfirming $(\Sexpr{prettyNum(100*mean(glmershf))}\%, SE = \Sexpr{prettyNum(100*glmershf.se)}\%)$ and \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$falsification==0 & was4d$incentive==0 & was4d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$falsification==0 & was4d$incentive==0])))} trials when it was affirming $(\Sexpr{prettyNum(100*mean(glmersha))}\%, SE = \Sexpr{prettyNum(100*glmersha.se)}\%)$, $t(588)$ = \Sexpr{prettyNum(mean(tsh))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsh),588)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsh)/sqrt(590))}$.  Similarly, they shared \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$error==1 & was4d$incentive==0 & was4d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$error==1 & was4d$incentive==0])))} trials when they attributed feedback to error $(\Sexpr{prettyNum(100*mean(glmersherr))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se)}\%)$ and \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$error==0 & was4d$incentive==0 & was4d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$error==0 & was4d$incentive==0])))} when they judged it to be accurate $(\Sexpr{prettyNum(100*mean(glmershnerr))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se)}\%)$, $t(590)$ = \Sexpr{prettyNum(mean(tsherr))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr),590)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr)/sqrt(592))}$.  At the end of the task, participants shared \Sexpr{prettyNum(length(na.omit(was4d$share.final[was4d$false.final==1 & was4d$incentive==0 & was4d$share.final==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share.final[was4d$false.final==1 & was4d$incentive==0])))} trials that they judged to be an error $(\Sexpr{prettyNum(100*mean(glmersherr.final))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se.final)}\%)$ and \Sexpr{prettyNum(length(na.omit(was4d$share.final[was4d$false.final==0 & was4d$incentive==0 & was4d$share.final==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share.final[was4d$false.final==0 & was4d$incentive==0])))} when they judged it to be accurate $(\Sexpr{prettyNum(100*mean(glmershnerr.final))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se.final)}\%)$, $t(853)$ = \Sexpr{prettyNum(mean(tsherr.final))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.final),853)))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr.final)/sqrt(855))}$.}

%$\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.final.chi))}, $p<$ \Sexpr{prettyNum(ptrunc(median(glmershatt.final.chip)))}.  
%As seen in Figure X.X, there was significant variation across participants in their decisions to share data after receiving disconfirming feedback, $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershfee.i.chi))}, $p=$ \Sexpr{prettyNum(ptrunc(median(glmershfee.i.chip)))}, whether they shared data that they perceived to be error during the task, $\chi^{2}(1)=$ \Sexpr{prettyNum(mean(glmershatt.i.chi))}, $p=$ \Sexpr{prettyNum(ptrunc(median(glmershatt.i.chip)))}, and whether they shared data that they perceived to be error at the end of the task, .  For all three judgments, most participants in the perverse incentive condition shared all of their trials, with a minority sharing less.  
%\footnote{Participants in the perverse incentive shared at similar rates to those in the compatible incentive condition.  They shared \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$falsification==1 & was4d$incentive==1 & was4d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$falsification==1 & was4d$incentive==1])))} trials when the feedback was disconfirming $(\Sexpr{prettyNum(100*mean(glmershf.i))}\%, SE = \Sexpr{prettyNum(100*glmershf.se.i)}\%)$ and \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$falsification==0 & was4d$incentive==1 & was4d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$falsification==0 & was4d$incentive==1])))} trials when it was affirming $(\Sexpr{prettyNum(100*mean(glmersha.i))}\%, SE = \Sexpr{prettyNum(100*glmersha.se.i)}\%)$, $t(xxx)$ = \Sexpr{prettyNum(mean(tsh.i))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsh.i),520)*2))}, $\emph{d} = \Sexpr{prettyNum(mean(tsh.i)/sqrt(523))}$.  They also shared \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$error==1 & was4d$incentive==1 & was4d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$error==1 & was4d$incentive==1])))} trials when they judged the feedback to be an error during the task $(\Sexpr{prettyNum(100*mean(glmersherr.i))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se.i)}\%)$ and \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$error==0 & was4d$incentive==1 & was4d$share==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share[was4d$error==0 & was4d$incentive==1])))} trials when they judged the feedback to be accurate $(\Sexpr{prettyNum(100*mean(glmershnerr.i))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se.i)}\%)$, $t(xxx)$ = \Sexpr{prettyNum(mean(tsherr.i))}, \emph{p} $<$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.i),520)*2))}, $\emph{d} = \Sexpr{prettyNum(mean(tsherr.i)/sqrt(523))}$.  At the end of the task, they shared \Sexpr{prettyNum(length(na.omit(was4d$share.final[was4d$share.final==1 & was4d$incentive==1 & was4d$false.final==1])))} of \Sexpr{prettyNum(length(na.omit(was4d$share.final[was4d$incentive==1 & was4d$false.final==1])))} trials that they judged to be an error $(\Sexpr{prettyNum(100*mean(glmersherr.final.i))}\%, SE = \Sexpr{prettyNum(100*glmersherr.se.final.i)}\%)$ and \Sexpr{prettyNum(length(na.omit(was4d$share.final[was4d$share.final==1 & was4d$incentive==1 & was4d$false.final==0])))} of \Sexpr{prettyNum(length(na.omit(was4d$share.final[was4d$incentive==1 & was4d$false.final==0])))} trials that they judged to be accurate $(\Sexpr{prettyNum(100*mean(glmershnerr.final.i))}\%, SE = \Sexpr{prettyNum(100*glmershnerr.se.final.i)}\%)$, $t(xxx)$ = \Sexpr{prettyNum(mean(tsherr.final.i))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(mean(tsherr.final.i),481)*2))}, $d=$ \Sexpr{prettyNum(mean(tsherr.final.i)/sqrt(484))}.}

<<weak testing and selective reporting,echo=false,results=hide,fig=false>>=
scammer.id<-c(1,3,15,16,19,36,57,68,85,96)
nonscammer.id<-c(2,4,6,7,8,9,10,11,13,14,17,18,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,60,61,62,63,64,65,66,67,69,70,71,72,73,74,75,76,77,78,79,80,81,82,84,86,87,88,89,90,91,92,93,94,95,97,98,99,100)
sneaky.stoppers<-c(31,53,60,65,86,87,90,92,94)
why.share.all<-c(42,54,55,56,63,73,78,88,98,100)
was3d$selective<-ifelse(was3d$subjectid %in% scammer.id,1,0)

shared.all<-data.frame(shared.all=c(rep(NA,100)))
incent<-data.frame(incent=c(rep(NA,100)))
subjectid<-data.frame(subjectid=c(rep(NA,100)))
for(i in 1:100){
shared.all[i,1]<-ifelse(length(na.omit(was4d$share[was3d$subjectid==i & was4d$falsification==1]))==0,NA,prod(na.omit(was4d$share[was4d$subjectid==i & was4d$falsification==1])))
incent[i,1]<-as.character(was4d$incentive[was4d$subjectid==i][1])
subjectid[i,1]<-i
}
shared.all.dat<-data.frame(shared.all,subjectid,incent,stringsAsFactors=FALSE)
shared.all.dat$shared.all<-as.factor(shared.all.dat$shared.all)
shared.all.dat$incent<-as.factor(shared.all.dat$incent)

                                 
sum(was4d$selective[was4d$incentive==0])/43
sum(was4d$selective[was4d$incentive==1])/43
was4d$hplus<-ifelse(was4d$num1==2 & was4d$num2==4 & was4d$num3==6,1,0)
hplusglmer<-glmer(hplus~incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))

act.att<-sum(na.omit(was4d$share.final[was4d$actual.error==1 & was4d$false.final==1]))
act.att.total<-length(na.omit(was4d$share.final[was4d$actual.error==1 & was4d$false.final==1]))
act<-sum(na.omit(was4d$share.final[was4d$actual.error==1 & was4d$false.final==0]))
act.total<-length(na.omit(was4d$share.final[was4d$actual.error==1 & was4d$false.final==0]))
att<-sum(na.omit(was4d$share.final[was4d$actual.error==0 & was4d$false.final==1]))
att.total<-length(na.omit(was4d$share.final[was4d$actual.error==0 & was4d$false.final==1]))
acc<-sum(na.omit(was4d$share.final[was4d$actual.error==0 & was4d$false.final==0]))
acc.total<-length(na.omit(was4d$share.final[was4d$actual.error==0 & was4d$false.final==0]))

att.data<-na.omit(was4d[was4d$actual.error==0 & was4d$error==1,c("share.final","num1","num2","num3","falsification")])
att.data.nshare<-na.omit(was4d[was4d$actual.error==0 & was4d$false.final==1 & was4d$share.final==0,c("share.final","num1","num2","num3","falsification")])
att.data.share<-na.omit(was4d[was4d$actual.error==0 & was4d$false.final==1 & was4d$share.final==1,c("share.final","num1","num2","num3","falsification")])
att.data.share.aff<-na.omit(was4d[was4d$actual.error==0 & was4d$false.final==1 & was4d$share.final==1 & was4d$falsification==0,c("share.final","num1","num2","num3","falsification")])

act.data.nshare<-na.omit(was4d[was4d$actual.error==1 & was4d$false.final==0 & was4d$share.final==0,c("share.final","num1","num2","num3","falsification")])
act.data.share<-na.omit(was4d[was4d$actual.error==1 & was4d$false.final==0 & was4d$share.final==1,c("share.final","num1","num2","num3","falsification")])
act.data.share.aff<-na.omit(was4d[was4d$actual.error==1 & was4d$false.final==0 & was4d$share.final==1 & was4d$falsification==0,c("share.final","num1","num2","num3","falsification")])

share.should<-glmer(share.final~actual.error+error+(1|subjectid),data=was4d[was4d$incentive==0,],family=binomial(link="logit"))
share.should.i<-glmer(share.final~actual.error+error+(1|subjectid),data=was4d[was4d$incentive==1,],family=binomial(link="logit"))
share.should.x<-glmer(share.final~actual.error*incentive*error+(1|subjectid),data=was4d,family=binomial(link="logit"))
@ 

Differing from Experiment Three, both attribution to error and actual error determined data sharing, with no interaction with the incentive.  There was a significant main effect of attribution to error ($t(1217)=$ \Sexpr{prettyNum(abs(fixef(share.should.x)[4]/sqrt(diag(vcov(share.should.x)))[4]))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should.x)[4]/sqrt(diag(vcov(share.should.x)))[4],12217)))}) and actual error ($t(1217)=$ \Sexpr{prettyNum(abs(fixef(share.should.x)[2]/sqrt(diag(vcov(share.should.x)))[2]))}, $p<$ \Sexpr{prettyNum(ptrunc(dt(fixef(share.should.x)[2]/sqrt(diag(vcov(share.should.x)))[2],1217)))}).  Overall, at the end of the task participants shared \Sexpr{prettyNum(act.att)} of \Sexpr{prettyNum(act.att.total)} (\Sexpr{prettyNum(100*act.att/act.att.total)}\%) trials that were both actual errors and perceived as errors, \Sexpr{prettyNum(act)} of \Sexpr{prettyNum(act.total)} (\Sexpr{prettyNum(100*act/act.total)}\%) trials that were actual errors but not perceived as errors, \Sexpr{prettyNum(att)} of \Sexpr{prettyNum(att.total)} (\Sexpr{prettyNum(100*att/att.total)}\%) trials that were perceived as errors but not actual errors, and \Sexpr{prettyNum(acc)} of \Sexpr{prettyNum(acc.total)} (\Sexpr{prettyNum(100*acc/acc.total)}\%) trials that were neither perceived as error nor actual error.

<<histograms,echo=false,fig=false,results=hide>>=
glmershatt.final<-glmer(share.final~false.final+(false.final|subjectid),data=was4d[was3d$incentive==0,],family=binomial(link="logit"))
a<-sim(glmershatt.final,100)
hist.final<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.final[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershatt<-glmer(share~error+(error|subjectid),data=was4d[was4d$incentive==0,],family=binomial(link="logit"))
a<-sim(glmershatt,100)
hist.err<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.err[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershfee<-glmer(share~falsification+(falsification|subjectid),data=was4d[was4d$incentive==0,],family=binomial(link="logit"))
a<-sim(glmershfee,100)
hist.fee<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.fee[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershatt.final.i<-glmer(share.final~false.final+(false.final|subjectid),data=was4d[was4d$incentive==1,],family=binomial(link="logit"))
a<-sim(glmershatt.final.i,100)
hist.final.i<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.final.i[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershatt.i<-glmer(share~error+(error|subjectid),data=was4d[was4d$incentive==1,],family=binomial(link="logit"))
a<-sim(glmershatt.i,100)
hist.err.i<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.err.i[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

glmershfee.i<-glmer(share~falsification+(falsification|subjectid),data=was4d[was4d$incentive==1,],family=binomial(link="logit"))
a<-sim(glmershfee.i,100)
hist.fee.i<-c()
for(i in 1:length(as.numeric(colnames(slot(a,"ranef")$subjectid)))){
  hist.fee.i[i]<-median(invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,i,1]+slot(a,"ranef")$subjectid[,i,2]))}

png(file="was4.png",width=1500,height=1000,res=200)
hist.fee.df<-data.frame(hist=hist.fee,Incentive=rep("Compatible",length(hist.fee)),Type=rep("Disc. Feedback",length(hist.fee)))
hist.feei.df<-data.frame(hist=hist.fee.i,Incentive=rep("Perverse",length(hist.fee.i)),Type=rep("Disc. Feedback",length(hist.fee.i)))
hist.err.df<-data.frame(hist=hist.err,Incentive=rep("Compatible",length(hist.err)),Type=rep("Trial-by-Trial Error",length(hist.err)))
hist.erri.df<-data.frame(hist=hist.err.i,Incentive=rep("Perverse",length(hist.err.i)),Type=rep("Trial-by-Trial Error",length(hist.err.i)))
hist.final.df<-data.frame(hist=hist.final,Incentive=rep("Compatible",length(hist.final)),Type=rep("End-of-Task Error",length(hist.final)))
hist.finali.df<-data.frame(hist=hist.final.i,Incentive=rep("Perverse",length(hist.final.i)),Type=rep("End-of-Task Error",length(hist.final.i)))
hist<-rbind(hist.fee.df,hist.feei.df)
hist<-rbind(hist,hist.err.df)
hist<-rbind(hist,hist.erri.df)
hist<-rbind(hist,hist.final.df)
hist<-rbind(hist,hist.finali.df)

p <- ggplot(hist, aes(hist,..count..,color=Incentive,fill=Incentive),opts(panel.grid.major = theme_bw() ,panel.grid.minor = theme_bw(),panel.background = theme_bw(),axis.ticks = theme_blank())) 
p + geom_histogram()+facet_grid(Type~Incentive)+theme_bw()+ylab("Frequency")+xlab("Proportion of Trials Shared")+scale_y_continuous(limits = c(0,20))+scale_color_manual(values = c("darkblue","darkred"))+scale_fill_manual(values = c("white","white"))+opts(legend.position="bottom")
dev.off()
@ 

%\begin{figure*}[h] \pause
%    \centering
%\scalebox{0.9}{\includegraphics[\textwidth]{was4}}
%\caption{Proportion of trials shared by whether the trial was disconfirming (top row), whether participants attributed that trial to error during the task (middle row), and whether participants attributed the trial to error at the end of the task (bottom row).}
%\label{fig:was4fighist}
%\end{figure*}

<<echo=false,results=hide,fig=false>>=
#Actual error share rate
#Are people satisficing or is the tendency to not explore the hypothesis space less motivational and more cognitive (i.e., they don't think to explore)?
#Are most people naive and don't perceive or think to look for a chance to game? What about Gino's deception research?
#Do they just not have enough opportunities or necessity to cheat?
#Many participants seemed to satisfice, proposing exactly six trials, all of which were H+ tests, all of which were consistent with their first and last hypothesis.
#What about hypothesis change?
#for the most part, actual errors can only harm people in the compatible incentive condition, but may help those in the perverse condition.  Was the actual error consistent with their final answer?
glmerA<-glmer(share.final.A~actual.error*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
#glmerA.zz<-glmer(share.final.A~actual.error.A*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
#Perception of error should no longer be related to data sharing, but it does; they were thinking about something other than removing errors
#glmerB<-glmer(share.final.A~actual.error*error*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
#Are they more likely to share triples that fit the rule?  So, before they know the answer, they are equally likely to share triples that fit the rule in compatible and incentive conditions. However, after they know the rule, they are less likely in the incentive condition.
glmerA.1<-glmer(share.final.A~TFTR*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
#glmerA.1.zz<-glmer(share.final.A~TFTR.A*incentive+(1|subjectid),data=was4d,family=binomial(link="logit"))
#glmerA.2<-glmer(share.final.A~TFTR*incentive*error+(1|subjectid),data=was4d,family=binomial(link="logit"))
#glmerA.3<-glmer(share.final.A~TFTR*incentive*false.final+(1|subjectid),data=was4d,family=binomial(link="logit"))
was4d$incons<-ifelse(was4d$falsification==was4d$cons,1,0) 
glmerA.4<-glmer(share.final.A~incons*incentive*TFTR+(1|subjectid),data=was4d,family=binomial(link="logit"))
#glmerA.4.zz<-glmer(share.final.A~incons*incentive*TFTR.A+(1|subjectid),data=was4d,family=binomial(link="logit"))
#glmerA.5<-glmer(share.final.A~actual.error*incentive*incons+(1|subjectid),data=was4d,family=binomial(link="logit"))
@ 

\subsubsection{Data Sharing with Full Information}

After learning the Actual Rule, participants in the perverse incentive condition did not share trials that they knew to be errors at a higher rate than those in the compatible incentive condition, $t(1185)=$ \Sexpr{prettyNum(abs(fixef(glmerA)[4]/sqrt(diag(vcov(glmerA))[4])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerA)[4]/sqrt(diag(vcov(glmerA))[4]),1187)))}.  Thus, they did not behave in an actively deceptive manner by communicating results that they knew to be false.  Instead, participants in the perverse incentive condition were more likley to share trials overall ($t(1187)=$ \Sexpr{prettyNum(abs(fixef(glmerA.1)[3]/sqrt(diag(vcov(glmerA.1))[3])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerA.1)[3]/sqrt(diag(vcov(glmerA.1))[3]),1187)))}), but less likely to share trials that fit the Actual Rule, a marginally significant interaction ($t(1187)=$ \Sexpr{prettyNum(abs(fixef(glmerA.1)[4]/sqrt(diag(vcov(glmerA.1))[4])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerA.1)[4]/sqrt(diag(vcov(glmerA.1))[4]),1187)))}).

<<was4graphs,echo=false,fig=false,results=hide>>=
#install.packages("quantreg")
#install.packages("ggplot2")
library(ggplot2)
library(quantreg)

wasqa<-was4d[c(was4d$incentive==0 & was4d$TFTR==1),]
wasqf<-was4d[c(was4d$incentive==0 & was4d$TFTR==0),]
wasqa.i<-was4d[c(was4d$incentive==1 & was4d$TFTR==1),]
wasqf.i<-was4d[c(was4d$incentive==1 & was4d$TFTR==0),]

phia<-lm(share.final.A~incons,data=wasqa)
phif<-lm(share.final.A~incons,data=wasqf)
phia.i<-lm(share.final.A~incons,data=wasqa.i)
phif.i<-lm(share.final.A~incons,data=wasqf.i)

incs<-data.frame(incons=1)
cncs<-data.frame(incons=0)

aincs.pred<-predict(phia,incs,interval="confidence",level=0.95)
acncs.pred<-predict(phia,cncs,interval="confidence",level=0.95)
fincs.pred<-predict(phif,incs,interval="confidence",level=0.95)
fcncs.pred<-predict(phif,cncs,interval="confidence",level=0.95)

aincs.pred.i<-predict(phia.i,incs,interval="confidence",level=0.95)
acncs.pred.i<-predict(phia.i,cncs,interval="confidence",level=0.95)
fincs.pred.i<-predict(phif.i,incs,interval="confidence",level=0.95)
fcncs.pred.i<-predict(phif.i,cncs,interval="confidence",level=0.95)

png(file="was4share.png",width=1000,height=1000,res=300)
# Create a simple example dataset 
df <- data.frame(
        Incentive= factor(c("Compatible","Compatible","Compatible","Compatible","Perverse","Perverse","Perverse","Perverse")),
        Incs= factor(c("Inc","Cons","Inc","Cons","Inc","Cons","Inc","Cons")),
        Probability = c(aincs.pred[1],acncs.pred[1],fincs.pred[1],fcncs.pred[1],aincs.pred.i[1],acncs.pred.i[1],fincs.pred.i[1],fcncs.pred.i[1]),
        ActualR = factor(c("TFTR","TFTR","TDNF","TDNF","TFTR","TFTR","TDNF","TDNF")),
        lim.low = c(max(0,aincs.pred[2]),max(0,acncs.pred[2]),max(0,fincs.pred[2]),max(0,fcncs.pred[2]),max(0,aincs.pred.i[2]),max(0,acncs.pred.i[2]),max(0,fincs.pred.i[2]),max(0,fcncs.pred.i[2])),
        lim.high=c(min(1,aincs.pred[3]),min(1,acncs.pred[3]),min(1,fincs.pred[3]),min(1,fcncs.pred[3]),min(1,aincs.pred.i[3]),min(1,acncs.pred.i[3]),min(1,fincs.pred.i[3]),min(1,fcncs.pred.i[3])))
# Define the top and bottom of the errorbars 1[was3d$incentive==0,]
limits <- aes(ymax = lim.low, ymin=lim.high) 
p <- ggplot(df, aes(colour=ActualR, y=Probability, x=Incs),opts(panel.grid.major = theme_bw() ,panel.grid.minor = theme_bw(),panel.background = theme_bw(),axis.ticks = theme_blank())) 
p + geom_crossbar(limits, width=0.1,position="dodge",size=0.3,linetype=1,alpha=1,fatten=5)+scale_y_continuous(limits = c(0,1))+theme_bw()+ylab("P(Share)")+xlab("Inconsistent")+scale_colour_manual(values = c("darkred","darkblue"))+facet_grid(.~Incentive)+opts(legend.position="bottom")
  dev.off()
@

%\begin{figure}[h] \pause
%    \centering
%\scalebox{1.2}{\includegraphics[\textwidth]{was4share}}
%\caption{Histogram of sharing consistent vs. inconsistent trials after knowing the rule.}
%\label{fig:was4consfig}
%\end{figure}

After being told the Actual Rule, those in the perverse incentive condition shared \emph{more} trials that fit the Actual Rule but were inconsistent with their Final Answer than those in the compatible condition, a significant three-way interaction, $t(1131)=$ \Sexpr{prettyNum(abs(fixef(glmerA.4)[8]/sqrt(diag(vcov(glmerA.4))[8])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerA.4)[8]/sqrt(diag(vcov(glmerA.4))[8]),1131)))}.

%participants shared trials that were inconsistent with their final answer less $t(1131)=$ \Sexpr{prettyNum(abs(fixef(glmerA.4)[2]/sqrt(diag(vcov(glmerA.4))[2])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerA.4)[2]/sqrt(diag(vcov(glmerA.4))[2]),1131)))}, and trials that fit the actual rule more $t(1131)=$ \Sexpr{prettyNum(abs(fixef(glmerA.4)[4]/sqrt(diag(vcov(glmerA.4))[4])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerA.4)[4]/sqrt(diag(vcov(glmerA.4))[4]),1131)))}, both significant two-way interactions.  However, there was a two-way interaction, where participants shared trials that were inconsistent with their final answer but fit the Actual rule at a lower rate $t(1131)=$ \Sexpr{prettyNum(abs(fixef(glmerA.4)[6]/sqrt(diag(vcov(glmerA.4))[6])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerA.4)[6]/sqrt(diag(vcov(glmerA.4))[6]),1131)))}.  There was another signficiant two-way interaction, such that participants in the perverse incentive condition shared trials that fit the Actual rule at a lower rate $t(1131)=$ \Sexpr{prettyNum(abs(fixef(glmerA.4)[7]/sqrt(diag(vcov(glmerA.4))[7])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(glmerA.4)[7]/sqrt(diag(vcov(glmerA.4))[7]),1131)))}.

%Our prediction was that some participants would be seduced by the perverse incentive, thus deciding only to share trials that were consistent with their final answer.  However, there was no difference between conditions in the probability of omitting data that were inconsistent with their final answer, $t(xxx)=$ \Sexpr{prettyNum(fixef(final.consistent.t)[4]/sqrt(diag(vcov(final.consistent.t))[4]))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(final.consistent.t)[4]/sqrt(diag(vcov(final.consistent.t))[4]),999)*2))}.  A second way that participants could produce these results while exploiting the perverse incentive would be to seek out only affirming data, knowing they data would make a simple and convincing story.  One way to implement this weak testing strategy is to propose the (2,4,6) triple, knowing that they would receive affirming feedback unless the feedback is in error.  However, participants in the two incentive conditions were equally likely to propose (2,4,6) triples, $t(xxx)=$ \Sexpr{prettyNum(abs(fixef(hplusglmer)[2]/sqrt(diag(vcov(hplusglmer))[2])))}, $p=$ \Sexpr{prettyNum(ptrunc(dt(fixef(hplusglmer)[2]/sqrt(diag(vcov(hplusglmer))[2]),1154)*2))}.

\subsection{Discussion}

As in Experiment Three, participants attributed disconfirming feedback to error more than affirming feedback.  However, those in the perverse incentive condition attributed affirming feedback to error at a lower rate, and disconfirming feedback at a higher rate, than those in the compatible condition.  Although this interaction was small, likely due to chance, it may reflect the perverse incentive blinding participants to finding fault in affirming feedback while making them more sensitive to finding fault in disconfirming feedback.  Supporting this, those in the perverse incentive condition were less sensitive to actual error when making their attributions.  Although these two findings can be interpreted as evidence of motivated reasoning, neither effects were large enough to undermine either Bayesian consistency or accuracy.  

As in Experiment Three, participants in both conditions shared fewer disconfirming trials, fewer trials attributed to error during the task, and fewer trials attributed to error at the end of the task.  Likewise, participants in both treatment groups exhibited a bimodal data sharing pattern of trials attributed to error at the end of the task, either sharing all or none of these data.  These data sharing judgments depended on attributions to error even after controlling for actual error.

New to Experiment Four, when participants were given full information about the Actual Rule, those in the perverse incentive condition shared fewer trials that fit the Actual Rule than those in the compatible incentive condition, but did not share trials that they knew were errors at a higher rate.  Consistent with the results of Experiment Three, participants in the perverse incentive condition who knew a triple fit the Actual Rule but did not fit their Final Answer shared those trials at a higher rate than those in the compatible incentive condition.  Whether explained by reactivity, ethics, or something else, there was no evidence that participants took advantage of the perverse incentive to be deceptive by sharing less data.  This indicates that it was not uncertainty or partial knowledge that led to greater data sharing.  The perverse incentive did not lead to data sharing policies that a simple game-theoretic analysis would suggest.

In sum, participants given a perverse incentive either naively or explicitly considered the welfare of the person receiving the data, and decided to share data to help the other participant.  This stands in contrast to the perception of biased researchers who dispose of data that would harm their company's (or their own) profit.  Instead, those with and without an incentive to deceive another person shared trials that they attributed to error less than those that they saw as accurate, even after controlling for actual errors.  Instead of motivated reasoning, in both Experiments Three and Four those in the perverse incentive condition performed slightly, but not significantly, better in terms of both Bayesian consistency and accuracy.  Thus, we find strong evidence for a `cognitive' file-drawer problem, and weak or no evidence for a motivational one.  

%This may be the problem of focusing on the evaluation of another (XX mercier) that helps reasoning.  It may also be an accountability effect (Tetlock and Lerner XX).  
\section{General Discussion}

Over 50 years of psychological research has found that hypothesis testing follows a positive test strategy \cite{klayman1987confirmation}, whereby people collect data that they expect to affirm their expectations and discount disconfirming data, should it nonetheless reach them.  The present study asks how the positive test strategy affects data sharing.  We use the Wason 2-4-6 rule discovery task \cite{wason1960failure}, adding the possibility of error to simulate the uncertainty of actual research \cite{penner1996trust}.  In this task, participants seek to discover a rule by conducting `experiments' to test their hypotheses about its answer, then receive affirming or disconfirming feedback, known to have a 20\% error rate.  We extended the task by adding several incentive schemes, then examining their effects on participants' decisions about sharing the feedback they received with another person.  We also evaluated participants' performance in terms of the accuracy and consistency of their judgments of whether the feedback is error.

Experiment One replicated the pattern of results from previous studies, finding that disconfirming feedback is attributed to error more often than is affirming feedback \cite{penner1996trust}.  A new result is that participants' error attributions were generally consistent with their prior beliefs, in the sense of their being more likely to attribute affirmative feedback to error when they had strongly expected that the triple would not fit the rule, and being more likely to attribute disconfirming feedback to error when they had strongly expected the triple to fit the rule.  However, their judgments of whether the feedback was in error were unrelated to its accuracy.  Whether they shared trial results was unrelated to whether the feedback was disconfirming or attributed to error.

Experiment Two replicated Experiment One along with a new condition that provided participants with a large financial incentive for discovering the rule.  As in Experiment One, participants attributed disconfirming feedback to error at a greater rate than affirming feedback in the control condition, but not the incentive condition.  Those in the control condition again made error attributions that were somewhat consistent with their expectations but were quite inaccurate.  In contrast, participants in the incentive condition were neither consistent nor accurate.  Experiment Two elicited data sharing decisions after each trial, using a fixed-response format, unlike Experiment One which asked a single open-ended question at the end.  Participants in both conditions were more likely to share feedback if it was affirming and perceived to be accurate.

Experiment Three introduced two incentive schemes for sharing data: (a) \emph{compatible} incentives rewarded the sharer and receiver based on the receiver's success; (b) \emph{perverse} incentives rewarded the sharer based on whether the receiver believed that the problem had been solved, and did not disclose when data were not shared.  Both conditions penalized participants for making inaccurate probability and error judgments.  As before, participants in both conditions were more likely to attribute feedback to error when it was disconfirming.  The penalty increased both the accuracy and consistency of error attributions for participants in both conditions, compared to Experiments One and Two.  Contrary to prediction, participants with the perverse incentive shared more trials that were disconfirming or attributed to error than did participants with the compatible incentive.  In both conditions, despite these participants' ability to identify error feedback, their perception of error was more important than actual error in determining their data sharing.

Experiment Four replicated Experiment Three and used three additional controls.  Most importantly, uncertainty about the validity and usefulness of each trial was resolved by giving participants the Actual Rule at the end of the task, allowing them to change the data they shared but without letting them change their Final Answer.  Additionally, demand characteristics were controlled by changing the `data sharing' wording to `communication', and participants were explicitly told that the person receiving the data could not know that they chose not to share trials.  Experiment Four again found that participants in both incentive groups attributed disconfirming feedback to error and shared perceived errors at a lower rate.  Again, those in the perverse incentive condition did not exhibit motivated reasoning in terms of reduced Bayesian Consistency or accuracy, and shared more trials than those in the compatible incentive condition that were consistent with the Actual Rule but inconsistent with their Final Answer.

Four experiments provide support for the following interpretation of human error identification, communication, and motivated reasoning.  In terms of error identification, people naturally attribute disconfirming feedback to error, and this is above and beyond what is justified by actual error.  However, when penalized for failing to do so, they can identify error objectively, and do behave in a consistent (Bayesian) manner when making their error identifications.  Thus, people were biased, but not bad.  In terms of communication, participants consistently saw trials that they perceived to be errors as not worthy of sharing with another person, even after controlling for whether these trials were actual errors.  There was no evidence of motivated reasoning, either in terms of misattributing disconfirming results to error, or sharing unwanted results that could reduce one's financial profit.  In fact, participants frequently exhibited `reactive' \cite{dillard2005nature} or `ethical' behavior when confronted with a perverse incentive that may have been seen as encouraging deception.

The circumstances of the experiments differ from those of working scientists in several ways.  First, scientists never know the exact error rates in their experiments, but have, instead, just a range of plausible values based on their experience and intuition.  Those ambiguous error rates may be more readily modified to fit results than the fixed ones used in the experiments.  Second, although the patterns observed here generally parallel those observed in real labs \cite{dunbar1995scientists}, the participants were either undergraduates or MTurk respondents, not scientists.  The training and experience of working scientists may allow them to identify and report only accurate data, appropriately omitting errors that would confuse readers.

The results of four experiments suggest that financial penalties are needed to help participants accurately evaluate their data.  Without such penalties, Experiments One and Two elicited error attributions that were largely inaccurate and inconsistent with prior beliefs.  In Experiments Three and Four, adding a financial penalty for incorrect judgments substantially increased consistency and accuracy.  However, they still shared data that were systematically biased by feedback, including inaccurate affirmations and excluding accurate disconfirmations.  This selective reporting occurred even when poor data sharing could cost the sharer money, as in the compatible incentive condition.

The difficulty participants had when trying to avoid sharing errors shows that helpful selective reporting is not easy.  One strategy participants could have used to achieve accurate selective reporting would be to use exact replications.  Participants in all three experiments did not have the perfect accuracy in error attributions that would be required to selectively exclude errors from shared data.  At the end of the task, exact replications would allow participants to clearly identify which trials were error and which were accurate, and, in turn, selectively report only accurate data.  

Similar policies can help real scientists share data.  Experiment Three found that penalties for incorrect probability judgments and error attributions greatly increased consistency and accuracy.  One way to implement such a penalty would be to require that statistical analyses and experimental methods presented in published reports provide enough detail, in the paper or ancillary material, to be reproducible--with appropriate professional penalties for those who fail.  As a protection, researchers can adopt the protocols of impartial organizations dedicated to independent replication of experiments and analyses (e.g., \url{https://www.scienceexchange.com/}).  Another way of improving error identification is to encourage researchers to complete exact replications.  These replications allow researchers to identify errors with high accuracy and make selective reporting of perceived errors highly accurate.  

\bibliography{/home/alex/Dropbox/masterbib}
\end{document}

Failing to share data is usually indirect and the harm is not clear and not financial.  For example, not reporting a failure to solve a homicide XXX.  Failing to include non-adherents in a drug trial XXX.  When generalizing to everyday lives of lay participants XX not telling others that we were wrong is not affected by perverse incentives?  Incentives are usually in the form of accountability to others, rather than financial (Lerner and Tetlock).  An incentive to reach a particular conclusion, as in the case of the perverse incentive condition, can lead to interesting behavior.  The person may want to maintain an ``illusion of objectivity'' (Pyszczynski and Greenberg, 1987; Kruglanski, 1980) and not realize they are biased.  Or they may abandon their beliefs entirely and just try to win the game by deceiving the other person.  There is evidence that participants will generate different hypotheses, evaluate them differently, choose different rules of inference and implement them differently, choose and evaluate different evidence, and share different evidence with others (Pyszczynski and Greenberg, 1987).  is false, disappointing the researcher, and because they make a less convincing report, disappointing the audience.  Because of the pressure to generate a correct theory, and convince one's audience that it is real (genuine or not), a hypothesis can be elevated from one of many solutions to the only solution, preventing researchers from accurately evaluating and effectively sharing data that support or refute it.  Experimental evidence supports this, finding that incentives to solve an insight task can harm performance by promoting more vigorous application of bad strategies (Bonner, Hastie, Sprinkle, \& Young, 2000; Glucksberg, 1962; McGraw \& McCullers, 1979), and observational research shows that pressures to publish \cite{fanelli2010pressures}, and competition \cite{ioannidis2005early}, are associated with selective reporting.  The combination of the desire to discover and convince create an environment at high risk for distorted reasoning and selective reporting \cite{kunda1990case}.  

\section{Experiment Four}

Experiment Four provides a new participant with either all of the trials collected by a participant in Experiment Three, or only the trials this person decided to share.

\subsection{Method}

\subsubsection{Participants}  Carnegie Mellon University undergraduates completed the task for 5 dollars. There were X women and average age of 

\subsubsection{Design}

The between-subjects manipulation provided participants in Experiment Four with either the full set of trials the initial participant conducted, or only the trials the original participant decided to share at the end of the task.

In a matched pairs design, two participants in Experiment Four were matched with each participant in Experiment Three 100 participants from the original study.

Thus, the design was a 2 x (full or shared data) by N (original participant's dataset) by 2 (incentive condition of original participant) between subjects design.

Participants from Experiment Three were selected using a random sequence generator from random.org.  A sequence of random integers was generated, selecting the first 15 for inclusion.

<<selection,echo=false,results=hide,fig=false>>=
compatibles<-sample(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0]))),15)
perverses<-sample(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1]))),15)
participants<-append(compatibles,perverses)
was4.datasets<-was3d[which(was3d$subjectid %in% participants),]
was4.datasets[was4.datasets$subjectid==perverses[1],c("subjectid","final.answer","num1","num2","num3","feedback","score")]

@ 


\subsubsection{Materials}
Several participants were omitted because their final answers did not make sense.
All participants were told the following: 

\begin{flushleft}
The editor was then given the researcher's shared or full trials along with the researcher's final answer (see appendix 2 for the editor's instructions).  
\end{flushleft}

\begin{flushleft}
The editor was then asked on a seven point scale (1=very unlikely, 7=very likely):
\end{flushleft}

\begin{quote}
In your opinion, how likely is it that this person's Final Answer is correct?
\end{quote}

\begin{flushleft}
They were then given a ``betting bonus round'':
\end{flushleft}

\begin{quote}
Now you can earn bonus money by betting on the Final Answer of the person.

The person's Final Answer was given a score from zero to five based on how correct it was.  Higher scores mean that the person was closer to the Actual Rule.  A score of five means that the person got the Actual Rule exactly.

You have 5 dollars (500 pennies) to bet. You can bet each penny on whether you think the person's Final Answer received a score of zero, one, two, three, four, or five. Only one of the scores is correct.  You will get one cent (0.01 dollars) for each penny you assign to the correct score.  For example, suppose you bet 50 pennies on zero. If the person's Final Answer score is zero then you get 0.50 dollars. 
\end{quote}

\begin{flushleft}
Finally, they tried to guess the actual rule themselves:
\end{flushleft}

\begin{quote}
What do YOU think the correct rule is (it can be mathematical or in words, please be as specific as possible)?  You can receive up to 5 dollars depending on how close your guess is to the Actual Rule.
\end{quote}

\subsection{Results}
\subsubsection{Full or Shared Data}
controlling for total trials
guess score
prevous participant accuracy

\subsubsection{Perverse vs. Compatible}
controlling for total trials
guess score
prevous participant accuracy

\subsubsection{Disconfirmations Shared}
controlling for total trials
Proportion of disconfirmation shared as covariate
guess score
prevous participant accuracy

\subsubsection{Error Attributions Shared}
controlling for total trials
Proportion of error attributions shared as covariate
guess score
prevous participant accuracy

\subsubsection{Actual Errors Shared}
Proportion of actual errors shared as covariate
controlling for total trials
guess score
prevous participant accuracy

\subsection{Discussion}

Might need to use a different initial triple and Actual rule (e.g., where the initial triple DNF the rule). 

experimental evidence suggests that those receiving data can infer whether they come from a knowledgeable or malicious source [You'll need to set up sharing-communication as a topic.  Currently, it appears first as the second clause in a complex sentence without an antecedent.] \cite{shaftolearning,shafto2008teaching,shaftoepistemic}, no evidence exists on the decision-making process of the person sharing the data. 

It is the greatest sin of all to overlook flaw in data that we like, as it is in nobody's interest to do so (that nature No shame article). 

However, it is rarely clear that these two assumptions are met in situations scientists usually face, where positive results are often the only ones that are reported (Fanelli, 2012), and researchers do not know the prevalence or magnitude of bias that results. Instead, selective reporting is likely to harm others, either by causing illusory patterns to emerge in the data that remain, or failing to stop mistakes from being repeated. 

Decisions about whether to share seemingly flawed data occur in a context where the livelihood of researchers depend on producing convincing discoveries.  These pressures can improve error identification by encouraging deeper, broader, and more complex evaluation of the data \cite{kunda1990case,tetlock1987accountability}.  Pressures can also harm judgment by blinding researchers to alternative perspectives that, if taken, would have made faults in hypotheses apparent when appropriate \cite{arkes1991costs,bonner2000review,glucksberg1962influence,mcgraw1979evidence}.  Optimism about the likelihood of verifying a flashy hypothesis may make falsifying data more likely to be perceived as faulty \cite{krizan2007influence}.  Consistent with this, observational research suggests incentives, in the form of pressures to publish, are associated with suppression of falsifying data from publication \cite{fanelli2010pressures}, and failures to replicate basic research \cite{ioannidis2005early}.

Creating and communicating high quality research requires scientists to defend against hordes of cognitive and motivational monsters.  Collected data may fail to separate important theories \cite{doherty1979pseudodiagnosticity,fischhoff1983hypothesis}, or not establish reliable methods when error is possible \cite{gorman1992simulating}.  Informative data, once selected, do not prevent biased inferences, such as incorrect conclusions about causality, or unwarranted omission of alternative hypotheses \cite{fischhoff1983hypothesis}.  Accurate inferences on informative data do not preclude failures to share the right data with others.  Unexpected, null, and unwanted data \cite{kunda1990case} are probably rarely shared \cite{fanelli2010pressures}, as they don't help one's career \cite{collins1975seven}, seem meaningless, and are perceived to be symptoms of flawed methods rather than refutations of incorrect theories \cite{dunbar2001scientific,gorman1989error,gorman1986possibility}.   

Coherence is a widely accepted normative criterion for judgment.  The normative strength of coherence comes from two consequences of having coherent beliefs: 1) A person with coherent (Bayesian) beliefs cannot be given a series of bets that guarantees a loss of money (a dutch book; \citeNP{danks2008explaining}); 2) coherence implies convergence of one's beliefs to the truth in the long run (of course, under some rather stringent assumptions: a finite dimensional parameter space; the truth is in the support of the prior; \citeNP{danks2008explaining,diaconis1986consistency,schulte1999logic}.

Not only does Bayesian coherence have normative appeal, but it has been successfully applied to many areas in engineering and cognition as a general framework for induction \cite<e.g.,>{griffiths2009theory,kemp2008discovery}.  For example, subjects in the Wason card selection task \cite{oaksford2007bayesian} can be seen as selecting a card so as to maximize the information gained from the selection with respect to subjective posterior distributions.  In fact, attribution of unexpected results to error would be predicted by a simple coherent Bayesian model, where one expects verification more than falsification ex ante and error is independent of the truth of a hypothesis.

Correspondence, or alternatively ecological rationality \cite{gigerenzer2004fast}, on the other hand, is the relationship between judgment and reality.  Judgment that is non-Bayesian but correct is not coherent but is ecologically rational.  Correspondence can be measured using signal detection theory, using True Positives, True Negatives, False Positives and False Negatives \cite{coombs1970mathematical}.  Along with this, an overall measure of correlation for contingency judgments, the phi coefficient, increases when either True Positives and True Negatives increase, and decreases when either False Positives and False Negatives increase \cite{cohen1983applied}.

Finally, we are interested in how data sharing policies affect the success of scientific knowledge creation.  Those receiving data can do no better in prediction than having all of the data \cite{shalizi2001computational}.  If both the sharer and receiver of data are altruistic and very perceptive, then it is possible to reduce noise and attention costs by sharing less than the complete set of data.  This is called \emph{pedagogical sampling} \cite{shafto2008teaching}.  However, bounded rationality and lack of common knowledge about each others' motives and beliefs may make pedagogical sampling difficult, if not impossible. 

Finally, scientists need to learn from others, in part by sharing data in the form of published papers.  A person receiving the data can effectively learn if she knows the data were not maliciously or haphazardly shared \cite{shaftolearning}.  It is rarely clear that these two assumptions are met.  Falsifying data may not seem informative to others, and as a result not worth sharing.  This applies to any scientific field on the ``frontier of knowledge'' where the meaning and usefulness of data are never clear \cite[p. 47]{de2006normal}.  In  the face of this uncertainty, scientists have to decide whether anomalous, noisy, or unexpected data should be `cleaned' and removed from publication, or whether this would constitute cooking the books.  Our hypothesis is that falsifying data are seen as due to error, uninformative, and not worth sharing with others.  We call this the \emph{differential diagnosticity} hypothesis, as affirmation is seen as diagnosing a true hypothesis more than falsifying data diagnoses a false one.

How is it possible that participants behaved in a coherent manner according to their subjective probabilities, but were also inaccurate?  Although their error attributions were consistent with their subjective beliefs ($\phi$ = 0.39) and their subjective beliefs corresponded to reality, \emph{r} = 0.39, 95\% CI [0.15, 0.64], \emph{t} (161) = 3.12, \emph{p} $<$ 0.05, the Bayesian model prescribes thresholds for judging error that are too extreme ($P(TFTR)>0.8$ for DNF and $P(TFTR)< 0.2$ for fit).  As a result, a subjective Bayesian given the beliefs of these participants would not predict actual error well, as indicated by a low association between an ideal Bayesian given the beliefs of the subjects in this experiment and actual error, $\chi^{2}(1)$ = 0.031, $\phi$ = 0.014.  Participants would, and did, do better in terms of identifying actual error to not act subjectively Bayesian.

Actual errors were in the opposite direction.  Pooling all participants together, there was a higher actual error rate for affirming (20/70; 95\% CI [0.19, 0.40]) than falsifying (8/93; 95\% CI [0.04, 0.14]) feedback.  This seems coincidental, if the errors were distributed randomly.  If I'm interpreting this correctly, then I'd move this down, as an aside.  That would connect the overall behavioral result in the first sentence with the elaboration in the rest of the paragraph. This is because they, on average, expected that their triples fit the rule more often than not (mean = 57\%, median = 50\%).  However, in reality, they only picked triples that fit the rule 35\% of the time.  Thus, if they were accurate in their perception of their rate of picking triples that fit the rule (35\%), they should have expected more errors in affirming rather than falsifying feedback, and not the reverse.  How is accuracy here related to accuracy below.

Experiment One did not support the differential diagnosticity hypothesis; participants were equally likely to share feedback judged as error and not error.  There are four problems with the method used in Experiment One.  First, the sample size was small enough such that any failure to detect an effect may have been due to low statistical power.  Second, participants had a hard time differentiating sharing trials from sharing triples, and this confusion resulted in some participants not having usable data.  Third, participants completed the sharing judgments after a long (30 minute) period of hypothesis testing, and thus they may have been tired or inattentive by this time, a maturation threat to internal validity \cite{shadish2002experimental}.  Finally, when deciding to publish data, it may be more likely that researchers decide whether data is publishable after each experiment is conducted rather than after the entire series of experiments is finished.  This is an external validity concern. 

The present experiment reveals a case where participants are coherent but not accurate.  This pattern is the opposite of what would be expected from the Heuristics and Biases approach of \citeA{tversky1974judgment}, who propose both incoherence and inaccuracy, or the Fast and Frugal Heuristics approach \cite{gigerenzer2004fast} that is mute on incoherence but maintains accuracy.

The validity of these error attributions has important implications for how science is taught and practiced.  Valid judgments indicate that researchers, by training or intuition, are equipped to spot and remove error from data.  Invalid judgments tell us that education and debiasing may be needed to help guide intuitions about experimental error, and that actions based on error attributions should be cautious.  

There are at least two ways error attributions made by researchers can be valid.  If data that refute a hypothesis are actually faulty, and consistent data actually flawless, then it is justified to attribute error to them accordingly.  Attributions of error are also valid if they are consistent with prior beliefs, according to Bayes' Rule.  This latter view has been supported recently by Bayesian psychologists (\citeNP<e.g.,>{oaksford2007bayesian,griffiths2009theory}) who argue that hypothesis testing and causal judgments are descriptively Bayesian, for a variety of tasks, including Wason's card selection task and Wason's 2-4-6 rule discovery task.  

Whether the data are consistent with one's hypothesis is not the only determinant of data sharing.  Data inconsistent with a theory are unwanted, both because they suggest the theory  [First use of discovery, which seems like a surprising perspective, given the paper’s opening with a view of scientists as not looking for discoveries.  Seems like you want something more mundane, like theories.  General point: Once you’re done formulating your ideas, go back and check that every term has a clearly introduced antecedent.  These problems should be mostly avoidable.]

<<exp3plot2,echo=false,fig=false,results=hide>>=
glmershatt.final.i<-glmer(share.final~false.final+(false.final|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
a<-sim(glmershatt.final.i,10)
par(mfrow=c(3,3))
N<-length(as.numeric(colnames(slot(a,"ranef")$subjectid)))
#for(j in 1:N){
#zz<-invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,j,1]+slot(a,"ranef")$subjectid[,j,2])
#zzz<-invlogit(slot(a,"fixef")[,1]+slot(a,"ranef")$subjectid[,j,1])
#zzzz<-data.frame(cbind(zzz,zz))
#colnames(zzzz)<-c("Accurate","Error")
#boxplot(zzzz,ylim=c(-0.05,1.05),xlab=c("Attribution"),ylab="P(Share)",main=j)}
share.should<-glmer(share.final~actual.error*false.final+(1|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
share.should.i<-glmer(share.final~actual.error*false.final+(1|subjectid),data=was3d[was3d$incentive==1,],family=binomial(link="logit"))
@ 

<<exp3plot1,echo=false,fig=false,results=hide>>=
glmershatt.final<-glmer(share.final~false.final+(false.final|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
glmershatt.final.int<-glmer(share.final~false.final+(1|subjectid),data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
glm<-glm(share.final~false.final,data=was3d[was3d$incentive==0,],family=binomial(link="logit"))
a.pooled<-coef(glm)[1]
b.pooled<-coef(glm)[2]
a<-sim(glmershatt.final,10)
par(mfrow=c(3,3))
N<-length(as.numeric(colnames(slot(a,"ranef")$subjectid)))
#for(j in 1:N){
#zz<-invlogit(slot(a,"fixef")[,1]+slot(a,"fixef")[,2]+slot(a,"ranef")$subjectid[,j,1]+slot(a,"ranef")$subjectid[,j,2])
#zzz<-invlogit(slot(a,"fixef")[,1]+slot(a,"ranef")$subjectid[,j,1])
#zzzz<-data.frame(cbind(zzz,zz))
#colnames(zzzz)<-c("Accurate","Error")
#boxplot(zzzz,ylim=c(-0.05,1.05),xlab=c("Attribution"),ylab="P(Share)",main=j)}
@ 

<<echo=false,fig=false,results=hide>>=
share.all.false<-c()
share.none.false<-c()
share.all.err<-c()
share.none.err<-c()
share.all.err.final<-c()
share.none.err.final<-c()
for(j in levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0])))){
share.all.false[j]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==j & was3d$falsification==1]))==0,NA,ifelse(prod(na.omit(was3d$share[was3d$subjectid==j & was3d$falsification==1]))==1,1,0))
share.none.false[j]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==j & was3d$falsification==1]))==0,NA,ifelse(sum(na.omit(was3d$share[was3d$subjectid==j & was3d$falsification==1]))==0,1,0))
share.all.err[j]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==j & was3d$error==1]))==0,NA,ifelse(prod(na.omit(was3d$share[was3d$subjectid==j & was3d$error==1]))==1,1,0))
share.none.err[j]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==j & was3d$error==1]))==0,NA,ifelse(sum(na.omit(was3d$share[was3d$subjectid==j & was3d$error==1]))==0,1,0))
share.all.err.final[j]<-ifelse(length(na.omit(was3d$share.final[was3d$subjectid==j & was3d$false.final==1]))==0,NA,ifelse(prod(na.omit(was3d$share.final[was3d$subjectid==j & was3d$false.final==1]))==1,1,0))
share.none.err.final[j]<-ifelse(length(na.omit(was3d$share.final[was3d$subjectid==j & was3d$false.final==1]))==0,NA,ifelse(sum(na.omit(was3d$share.final[was3d$subjectid==j & was3d$false.final==1]))==0,1,0))
}

share.all.false.i<-c()
share.none.false.i<-c()
share.all.err.i<-c()
share.none.err.i<-c()
share.all.err.final.i<-c()
share.none.err.final.i<-c()
for(j in levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1])))){
share.all.false.i[j]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==j & was3d$falsification==1]))==0,NA,ifelse(prod(na.omit(was3d$share[was3d$subjectid==j & was3d$falsification==1]))==1,1,0))
share.none.false.i[j]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==j & was3d$falsification==1]))==0,NA,ifelse(sum(na.omit(was3d$share[was3d$subjectid==j & was3d$falsification==1]))==0,1,0))
share.all.err.i[j]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==j & was3d$error==1]))==0,NA,ifelse(prod(na.omit(was3d$share[was3d$subjectid==j & was3d$error==1]))==1,1,0))
share.none.err.i[j]<-ifelse(length(na.omit(was3d$share[was3d$subjectid==j & was3d$error==1]))==0,NA,ifelse(sum(na.omit(was3d$share[was3d$subjectid==j & was3d$error==1]))==0,1,0))
share.all.err.final.i[j]<-ifelse(length(na.omit(was3d$share.final[was3d$subjectid==j & was3d$false.final==1]))==0,NA,ifelse(prod(na.omit(was3d$share.final[was3d$subjectid==j & was3d$false.final==1]))==1,1,0))
share.none.err.final.i[j]<-ifelse(length(na.omit(was3d$share.final[was3d$subjectid==j & was3d$false.final==1]))==0,NA,ifelse(sum(na.omit(was3d$share.final[was3d$subjectid==j & was3d$false.final==1]))==0,1,0))
}

@ 

\begin{table}[h]
\begin{tabular}[h]{c c c c c}
Measure & Condition & \% Share All & \% Share None & Mean Share \% \\ \hline
Falsification & Compatible & 
\Sexpr{prettyNum(sum(na.omit(share.all.false))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0])))))} & 
\Sexpr{prettyNum(sum(na.omit(share.none.false))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0])))))} & 
\Sexpr{prettyNum(mean(was3d$share[was3d$falsification==1 & was3d$incentive==0],na.rm=TRUE))}\\
Error & Compatible & 
\Sexpr{prettyNum(sum(na.omit(share.all.err))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0])))))} & 
\Sexpr{prettyNum(sum(na.omit(share.none.err))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0])))))} & 
\Sexpr{prettyNum(mean(was3d$share[was3d$error==1 & was3d$incentive==0],na.rm=TRUE))}\\
Final Error & Compatible & 
\Sexpr{prettyNum(sum(na.omit(share.all.err.final))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0])))))} & 
\Sexpr{prettyNum(sum(na.omit(share.none.err.final))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==0])))))} & 
\Sexpr{prettyNum(mean(was3d$share.final[was3d$false.final==1 & was3d$incentive==0],na.rm=TRUE))}\\
Falsification & Perverse & 
\Sexpr{prettyNum(sum(na.omit(share.all.false.i))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1])))))} & 
\Sexpr{prettyNum(sum(na.omit(share.none.false.i))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1])))))} & 
\Sexpr{prettyNum(mean(was3d$share[was3d$falsification==1 & was3d$incentive==1],na.rm=TRUE))}\\
Error & Perverse & 
\Sexpr{prettyNum(sum(na.omit(share.all.err.i))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1])))))} & 
\Sexpr{prettyNum(sum(na.omit(share.none.err.i))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1])))))} & 
\Sexpr{prettyNum(mean(was3d$share[was3d$error==1 & was3d$incentive==1],na.rm=TRUE))}\\
Final Error & Perverse & 
\Sexpr{prettyNum(sum(na.omit(share.all.err.final.i))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1])))))} & 
\Sexpr{prettyNum(sum(na.omit(share.none.err.final.i))/length(levels(as.factor(as.character(was3d$subjectid[was3d$incentive==1])))))} & 
\Sexpr{prettyNum(mean(was3d$share.final[was3d$false.final==1 & was3d$incentive==1],na.rm=TRUE))}\\ \hline
\end{tabular}
\end{table}

\subsection{Individual-Level Sharing Policies}

Scammer: omission of non actual error that inconsistent with Final Answer.

The positive test strategy could be used to avoid collecting evidence that one doesn't wnat to have to share.  Could be to compare mean number of H+ trials proposed.

Many participants had no opportunity or reason to scam, as they proposed H+ trials, got affirmation, then quit.  This may be one strategy: collect just enough data to be convincing and quit before anything goes wrong.

Could it be that peope who start with a bad hypothesis (bad intuition; participant (54)) end up getting confused, screwed, and seduced?  Seems like people are particularly vulnerable at the beginning, especially if they propose an unlucky triple, or get error right away.

Maybe they thought that the more information they share, the more confident the participant would be in their final answer, regardless of whether the trials shared matched their final answer.

Because they don't know their final answer during the task, those in the perverse incentive condition may have just decided to share all the trials because of ambiguity.  At the end of the task, some of them realized they could scam, and did.

Motivated reasoning among scammers?  Were their final error attributions among scammers bad?

An alternative strategy to not sharing negative data is to not look for negative data.  Do perverse and compatible conditions differ in the number of H+ and H- tests?  For example, in the perverse condition just collect a few trials that are expected to be affirming and share them?

To understand the individual-level variation better, I looked at individual level data sharing policies.  Coding them for scammer or not scammer.  It seems like at the end of the task participants found it easiest to just share all trials??  A participant was counted as a scammer if they omitted trials that were inconsistent wth their final answer that were not errors, ethical if they included all inconsistent trials, and neither if they never collected a trial that was inconsistent with their final answer.

A confluence of factors would lead them to share them all trials at the end of the task: 1) laziness, 2) frustration, 3) seeing them all as valuable, 4) taking an ethical stance.  They did not seem, at the end of the task, to expect cleaning the data to be helpful. 

During the task, however, these factors are not at play; only the incentive is different.

\subsubsection{Participant 1}
Participant one completed three trials.  This person's final answer was ``take the first number, double that, then add two''.  This does match the person's behavior in the task, where they attributed error to a false feedback on (30,32,34), then seemed to change their hypothesis to the final answer, proposed that triple, and stuck with it.  This person only made one judgment at the end of the task, which was to share the third trial that fit their final answer.  This person was in the perverse incentive condition, and thus seemed to hide nevative data by not making judgments (NA) on trials that she did not want to share.  Might it be that people who scam me (by completing few trials) also scammed the other person?

\begin{table}[h]
  \begin{tabular}{c c c c c c}
    Num1 & Num2 & Num3 & Feedback & Share & Error \\ \hline
    22 & 24 & 26 & FIT & Share & Accurate \\
    30 & 32 & 34 & DNF & No & Error \\
    4 & 8 & 10 & FIT & Share & Accurate \\ \hline
\end{tabular}
\end{table}

\subsubsection{Participant 2}
This person completed sixteen trials.  This person seemed to start out with the usual ascending consecutive evens (12,14,16).  Tested H- triples of (5,7,9) and (7,9,11), both gave the expected answer (DNF), and shared them as they were not seen as error. Went to (102,104,106) and got DNF, then attributed it to error.  Continued to share triples that confirmed the ascending consecutive evens, attributing error to stuff inconsistent with this.  Came on the boundary again (98,100,102) but seemed to respect it the second time, including it in the final answer, scoring a 4.  The person shared all trials at the end, rather than sticking with the original sharing judgments (lazyness?).  Made only one final error attribution to (34,36,38), which was an error.  This person was in the pervserse condition. 

\subsubsection{Participant 3}
This person started with an uncommon inital rule of multiply by two then add two.  First proposing (8,10,12), getting affirmation, then attributing it to error, next proposing (14,30,62) getting falsification and attributing it to error. This person could not collect one trial that supported her hypothesis, but retained it throughout.  At the end fo the task, this person shared no trials, attributing all of them to error.  Why would this person not share any trials?  Frustration, laziness?

\subsubsection{Participant 4}
This person seemed to start with ascending, consecutive evens as the initial hypothesis, but proposed an H- trial initially (25,27,29), getting falsification, not sharing it, and attributing it to error (very weird).  The person then proposed a series of H+ trials, omitting one from sharing that was an error (56,58,60).  The next H- test (57,59,61) was not seen as an error this time when it came up disconfirming, but (33,35,37) was.  At the end of the task, the person just shared all of the data, and made correct erorr attributions (56,58,60), but not (56,58,62).  This person also missed error on (98,100,102) and (1002,1004,1006), both affirming.  The final answer was very good, ascending consecutive evens starting at 2.  Compatible condition.

\subsubsection{Participant 5;246810sm}
This participant collected a lot of trials, with many different hypotheses/tests.  The person started out with (1,7,9) a very strange one, got positive feedback, and shared it.  Actually, this person seemed to decide from the very beginning that she was going to share all of the trials.  This person did not complete the final attributions and sharing. 

\subsubsection{Participant 6}
This person started with some version of ascending consecutive evens, proposing (10,12,14) first, receiving disconfirmation, attributing it to error and not sharing. This person continued several more trials with affirming feedback.  I don't htink this person was a scammer because the (8,10,12) that was omitted at the end was an obvious error from this person's perspective.  Multiples of two in sequential order was the final answer.

\subsubsection{Participant 7}
This person seemed to have the standard initial hypotehsis.  Omitted one trial from sharing that was an error (12,14,16; DNF) and one that was also an error (3,5,7,FIT) but failed to attribute the latter to error, but then subsequently did with (7,9,11, DNF) twice, attributing both to error.  Seemed to misunderstand the error attribution?  Corrected the eror attributions at the end of the task, but omitted disocnfirming trials that supported the initial hypothesis (7,9,11; DNF).  Final answer was add two to each number starting with an even.

\subsubsection{Participant 8}
This person proposed (4,8,12) initially, obviously an unusual hypotehsis.  This trial was falsifying, attributed to error, and not shared.  The rest of the trials were (2,4,6), and all shared except one falsifying/error trial.  At the end, this person omitted a (2,4,6) error and a (4,8,12; DNF). The final answer seemed to be ascending consecutive evens starting from two.  The final answer was hard to follow.

\subsubsection{Participant 9}
Started with a usual hypothesis and triple (8,10,12).  Moved to the boundary (100,102,104; DNF) and saw it as error, but still shared it.  Got another actual error (30,32,34; DNF), now seeing it not as error.  Gets back on track with more ascending consecutive evnes, then hits a bump (72,74,76;DNF), correctly identifying it as eror.  Hits the boundary again (102,104,106; DNF) initially not sharing it, but then sharing it in a replication.  At the end, the person just shared everyhting, even two correct attributions to error.  Sequential even numbers less than 100 was proposed, a very good answer.  So why share all trials at the end of the task?

\subsubsection{Participant 10}
This person started out with a usual hypothesis (8,10,12;DNF) attributing it to error and not sharing. Proceded normally with a few H- trials (1,3,5; DNF) not attributed to error, as expected.  Tried a downward sequence (10,6,8; FIT) and correctly attributeed it to error, then got the correct feedback (10,6,8;DNF) and didn't attribute it to error.  Hit the upper boundary first (100,102,104;DNF) attributing it to error, then replicating (100,102,104;DNF) and changing the theory.  Downward triples to be allowable (88,86,84; FIT) attributing it to error, but then again replicating (86,84,82;DNF) not attributing it to error.  During the task, the person shared all the trials except the first one.  I have no explanation for why.  At the end of the task this person omitted almost every trial attributed to error and was accurate on almost all of them.  Final answer was single or double digit consecutive ascending evens, almost an exact score.

\subsubsection{Participant 11}
This person conducted five trials, all H+ and affirming, no errors, and shared them all.  Same at the end of the task. Proposed ascending consecutive evens.

\subsubsection{Participant 12}
This person did one trial (8,16,24, DNF) shared it then quit.  No final judgments, no final answer.

\subsubsection{Participant 13}
This person completed a lot of trials.  Started out in the usual way with (6,8,10; DNF) and sharing it.  Hit two errors in a row (10,12,14;DNF) and (4,6,8;DNF), correctly attributing both to error and sharing neither.  Kept H+ trials until three errors in a row with (50,52,54;DNF) correctly attributing all to error and sharing none.  I don't understand the final sharing policy at all.  Many affirming trials with no error were omitted, and many trials correctly attributed to error were included.

\subsubsection{Participant 14}
Five trials, all H+ for usual hypothesis, with one error on the fourth trial (8,10,12;DNF) correctly identified.

\subsubsection{Participant 15}
Conducted many trials.  Started off with some weird hypotheses (6,12,18; DNF), not shared but not seen as error.  Then another weird one (155,157,159;DNF), this time shared and attributed to error; very weird.  Several more weird ones (10,12,16;DNF) not seen as error and not shred, then (220,222,224;DNF) seen as error and not shared.  Then a more normal one (68,70,72;DNF) not seen as error but shared. Then on to the hypothesis of 2x then 2x+2 (8,16,18;FIT) and shared.  Then tried it again (100,200,202;DNF) now seeing this as error.  At this point the participant is very conused, and gets two more errors in a row that support her hypothesis (26,72,74;FIT) and (40,80,82;FIT) both shared, making the person think that x,2x,2x+2 is correct.  Trying again, though, suddenly it stops working  (17,34,36;DNF) and (36,72,74;DNF) not shared and attributed to error.  Then the person seems to give up on the x,2x,2x+2 after two more failures (35,70,72;DNF) and (4,8,16;DNF) both seen as valid and both shared.  This person moves to $x,x^{2},x^{2}+2$ getting more disconfirmation (4,16,18;DNF), then an error (4,16,6;FIT) which was shared.  Another failure of the new hypothesis (9,81,83;DNF) attributed to error, then an other unfortunate error for a new hypthesis $x,x^{2},x+2$ which no longer fits the initial triple.  These failures continue until the end.  The person finally goes with $x, 2x, 2x+2$ as a Final Answer.  The final data sharing policy seems to perfectly omit trials that do not fit this hypothesis.  A clear scamming attempt.

\subsubsection{Participant 16; easterbunny}
Completed a lot of trials.  Except for the first trial, shared all trials during the task.  No idea why.  Final answer was $x,x^{2}+2,x^{2}+2$ I think.  Clearly scammed at the end.

\subsubsection{Participant 17;queen24}
Collected only five trials, seemed to start with a weird hypothesis (7,15,18;FIT), and seemed to go off track right away.  Attributed all trials to error and shared them all.  This person got 4 errors on five trials!  Shared everything again at the end of the task.  Nonsense final answer.  Don't think this person had any idea what was going on.

\subsubsection{Participant 18;DJJ4230MTURK}
Again, from the very beginning shares all trials.  Starts with a usual hypothesis (10,12,14;DNF) and correctly attributes it to error. Sticks with the ascending evens, making one weird error attribtion (8,10,12;FIT; error), two more correct ones (20,22,24;DNF) twice.  Shared everything again at the end of the task. Made two strange error attributions at the end of the task (7,9,11;DNF) and (15,17,19;DNF), especially with a final answer of ascending consecutive evens.

\subsubsection{Participant 19}
Collected only three trials (1,3,5;DNF), (6,12,14;DNF), (3,5,7; FIT).  Called the first two errors and didn't share, and shared the last one.  Didn't complete the end of the task and proposed a final answer that was consistent with the only trial shared $x,x+3-1,x+3+3-1-1$.

\subsubsection{Participant 20}
Started with a weird hypothesis (3,6,9;FIT) and shared it.  Then tried to replicate twice (3,6,9; DNF) and failed both times, sharing it the second time.  Then proposed a more usual triple (8,10,12;FIT) and shared it, then tried (3,6,9;DNF), shared it, but also attributed it to error.  This person's final answer was evens, and this mostly matched the data shared in the end.

\subsubsection{Participant 21;291284}
Shared all trials from the very start.  Started with (10,12,14;FIT) and shared it, then went to (5,7,9;DNF) and shared it, but also attributed it to error (must have misunderstood).  Then came to the lower bound but got an error (0,2,4,FIT) and shared it.  Went to (1000,1002,1004;DNF) and shared it but also attributed it to error.  At the end this person just shared all the data again.

\subsubsection{Participant 22}
Started with a weird hypothesis (3,5,7;DNF) shared it and attributed it to error.  Then went to (10,12,14;FIT) and shared it.  Went back to (1,3,5;DNF) and saw it as error and dint' share. Then (3,5,7;DNF) saw it as error but shared it.  Strange.  Just shared everythign at the end of the task and made no error attributions, I guess not trying by then.  Every number increases by two was the final answer.

\subsubsection{Participant 23}
This person basically did 5 H+ trials, got affirmation on all and shared and stopped. Got no errors.  No opportunity to scam.

\subsubsection{Participant 24}
Very similar to 23.  5 H+ trials, all confirming, shared all, no errors.  Ascending evens.  No opportunity for scamming.

\subsubsection{Participant 25}
Person collected only 3 trials, starting with  H+ trials, sharing them, then getting (20,40,60;DNF) sharing it and ending.  Didn't make final attributions.  Proposed increasing evens by two.

\subsubsection{Participant 26}
Started with H+ (10,12,14;FIT) shared it.  Continuing then omitting one H+ (8,10,12;FIT) possibly becuase of reducndancy.  Then proposed (14,24,38;DNF) and shared it, then (4,6,12;DNF) and shared it.  Then got two errors (10,12,14;DNF) and (8,10,12;DNF) and didn't share them.  At the end the person omitted two erros that were both actual errors.

\subsubsection{Participant 27}
Started with an H+ (8,10,12;FIT) shared it but also attributed it to error. Go some H- (28,50,60;DNF) and (16,30,40;DNF), but didn't share the latter.  This person didn't share falsifying trials, incorrectly attributin gthem to error, but they weren't inconsistent with the final answer.

\subsubsection{Participant 28}
This person shared all trials right from the start getting H+ trials but with three errors.  The person correctly identified all three errors.  Again shared all trials at the end of the task.

\subsubsection{Participant 29;2003492395935}
Shared all trials right from the start.  Began with H+ (8,10,12;FIT).  Got some falsifying trials and incorrectly attributed the mto error (must have misunderstood).  Again shared everything at the end. 

\subsubsection{Participant 30;29881}
Matt Goetz: A3VY8B6YM3T5D6

Began with weird triple (12,14,18;DNF) shared it then followed up with (2,8,10;DNF).  Shared all trials. Still shared all trials at end of task, and made weird erro attributions.  Went with even numbers below 20, which explains the eror attributions.

\begin{quote}
``My thinking was to establish a narrow band of options first which continued my assumed pattern forward, and then progressively widening the gaps of that band. I'd occasionally repeat the narrow band to refresh my certainty (such as it was) with my assumption. The larger gaps and skewed numbers were a way of testing that theory at the outside edge.''
  
  ``After the initial stage, I thought I would share information I'd presented in the hopes of furthering the success of anyone who attempted to discover the rule after me.  After all, my sharing can help others and has no negative impact on me. Why wouldn't I, at that point, be happy to share my results?''
\end{quote}

  

\subsubsection{Participant 31}
Just proposed the same triple (8,10,12;FIT) five times and shared all.  Shared all at the end.

\subsubsection{Participant 32}
Collected some H+ trials, but omitted some at the end that seemed to be redundant.  Also omitted one actual error.  At the end, shared everything except the one error.

\subsubsection{Participant 33}
Started with an odd triple (4,16,20;DNF) shared it.  Followed up with another weird one (4,16,36;DNF) again shared it. Only didn't share one trial (10,20,30;DNF) which was incorrectly attributed to error. Shared everything at the end of the task, but also strangely attributed them all to error.  Possibly just clicked through.

\subsubsection{Participant 34;math1}
Mark Thoma: A3UTT0I3W37RSE 

Shared everything right from the start.  Made some correct erro attributions and stuck with ascending consecutive evens with a few H- trials.  Again shared everything at the end.

\begin{quote}
``Well, I tried to find the mathematically simplest rule that would work.  I think I started with the idea that the addition of 2 to the previous number was the rule, provided that the previous number was 0 or even.  Most of the time, that seemed to wok, though there were some times that it didn't.  But about 20\% of the tome the computer rating of FIT/DNF could be wrong.  So I reasoned (but didn't calculate) that my original assumption could be the rule/  I think I did try at least two other possibilities.  One was that the initial numbers given could be the square roots of other numbers.  But that didn't seem to work.  I think I also tried using the ``add two'' rule to odd numbers, but that didn't work.

  I also thought about things like: using a base other than base 10, using logs, etc. but didn't investigate those possibilities.

  I shared everything because, not knowing if the FIT/DNF response by the computer was correct, I didn't want to deliberately bias the info I passed on by being selective.  
\end{quote}


\subsubsection{Participant 35}
All H+ triples, with a few errors correctly attributed to error and not shared.  Same strategy at end of task, omitting actual errors.

\subsubsection{Participant 36}
Three H+ trials (8,10,12) but the last one was DNF which was not shared.  Then did (6,6,6;DNF) and nto shared, and (6,3,0.75;FIT) and shared.  Bizarre final answer that is descending.  Seemed to try to scam but failed.

\subsubsection{Participant 37}
Tried different arrangements of the numbers 2,4,6.  Shared all trials except a replication of (4,6,2;DNF).  Shared everything at the end.  No final answer.  Didn't seem to understand the task.

\subsubsection{Participant 38;9841510784}
Shared everything.  Started with a weird triple (2,2,2;DNF), then went to normal H+ ones with one correct error attribution after (12,14,16;DNF).  Shared everything at the end again.

\subsubsection{Participant 39;3804MT}
Pam Wong: A2WP0DRQ2QU7MH

Shared everything from the start.  Started with (2,4,6;DNF) and attributed it to error.  Then went to (6,4,2;DNF) attributing it to erorr, then (1,2,3;DNF) but not attributing it to error.  Then finished with three replciations of (2,4,6;FIT).  Again shared eveyrthign at the end, with only 1 error attribution that was correct.

<<shared all data,echo=false,fig=false,results=hide>>=
klr<-c(5,12,16,17,18,21,25,28,29,30,34,38,39,40,41,43,44,45,47,48,52,55,59,60,61,62,63,66,69,70,73,74,76,84,86,88,90,91,94,96,98)
@ 

\subsubsection{Participant 40}
Shared everything from the start with all H+ triples.  Only one false feedback at the end that was not attributed to error (6,8,10;DNF). No final judgments.

\subsubsection{Participant 41}
Shared everything from the start.  All H+ triples with two errors but weren't identified.  Shared all at the end of the task and correctly identified both the errors.

\subsubsection{Participant 42;85143}
Started with (8,10,12;FIT) was shared.  Then (4,6,10;DNF) shared, then (4,6,10;FIT) shared.  Seemed to be moving around in hypotheses (8,10,18;DN) seen as error, then (10,20,30;FIT) shared.  (15,15,30;DNF) not shared and seen as error.  Kept proposing triples that didn't fit and incorrectlya ttributing them to error. then finally gets to (22,24,26;FIT) and seems to settle on ascneding evens.  At the end of the task just shared everything, still making incorrect eror attributions.

\subsubsection{Participant 43;141950subramanian}
Sidhu Ram

Shared all trials with two correct error attributions on (8,10,12;DNF) and (10,12,14;DNF).  Shared everything at end of task again.

\subsubsection{Participant 44;670557}
Shared everything from the beginning.  Began with H+ (20,22,24;FIT) then hit the boundary (108,110,112;DNF) thought it was an error but still shared it.  Got a real error (16,18,20;DNF) but identified it.  Shared all at the end of the task.

\subsubsection{Participant 45;A2IDLKSKCZTIGS}
Usual H+ (8,10,12;FIT) shared, then hit the boundary but thought it was an error (100,102,104;DNF) but still shared it, then (2,4,6;FIT) but didn't share it, then two more shares.  Shared everything at the end.

\subsubsection{Participant 46;mturk123mturk}
Started with H+ (8,10,12;FIT), then got (3,5,7;DNF) and didnt think it was error.  Then went (-2,0,2;FIT) and shared it, nto seeing error, then (-8,-6,-4;DNF) thinking it was error and not sharing. Then (-4,-2,0;DNF) but now shared although seen as error.  Hit the boundaries twice (-2,0,2;DNF) and (102,104,108;DNF) and shared both.  Got a few errors that weren't shared.  No end of task judgments.  Almost got the rule with $n,n+2,n+4 where 2>=n<=92$.

\subsubsection{Participant 47;2468}
Shared everything from the start, with one incorrect error attribution (5,10,15;DNF).  Shared everything at the end with all five correct error attributions. 

\subsubsection{Participant 48;rothris119}
Shared all trials but got the first (6,8,10;DNF) correctly attributed to error and shared.

\subsubsection{Participant 49;44290}
Participant went with usual trisl (4,6,8;FIT) with a couple disconfirming (3,6,9;DNF) initially perceived to be error then not.  Didn't share an error (2,4,6;DNF) and (4,6,8;DNF).  Same data sharing pattern at the end.

\subsubsection{Participant 50;20015a}
Usual pattern (14,16,18;FIT) with one no share (16,18,20;FIT) not sure why.  Same sharing pattern at the end of the task.

\subsubsection{Participant 51;thousandarms97}
Usual pattern withh one error (22,24,26;DNF) correctly identified and not shared. Same sharing at the end.

\subsubsection{Participant 52;7346332}
Shared all.  No errors, no error attributions.  Same at the end.

\subsubsection{Participant 53;A1Q0QCHCD2YOIR}
Michael Burke: A1Q0QCHCD2YOIR
Seemed to be a sneaky person.  Only conducted five trials all the same (8,10,12;FIT).

\begin{quote}
``It's been a while. From what I remember:

I was given the same three numbers in every instance (2, 4, 6). I think the rule I input was "even numbers, multiples of 2" or something similar. I knew I could get cute, and change the rule (i.e., 2 times 1, times 2, times 3, times 4, etc.), but I felt it was best to make sure that the rule was easy to understand, and in all honesty, easy to type. Thus, even numbers, increasing by 2.

The instructions had stated that I'd get twenty tries to figure out the rule, and that I'd also get three practice tries. And that the practice round "answers" were the same as the actual trials. I honestly expected a more difficult set of numbers. Since I was told at the onset that the practice was the same as the actual, and right off the bat I got the practice question right, then it was just a matter of doing the trial a couple more times to make sure that I didn't get a false computer reading.

Getting "FIT" six times from the "computer" was sufficient enough (in my opinion) that I wasn't getting false answers from the computer. Even though I didn't answer "100%" on the slider reflecting whether I thought I was right, by turn five I was fairly certain that I was correct in determining the rule. I knew that there was a chance of there being a trap, and that if I continued doing all the trials one or two later trials could show up as false from the computer, but as mentioned I was feeling fairly confident that I figured out the rule.

I can't remember the requirements for the Share function, assume it's whether or not to share my three numbers (8, 10, 12) with another person so they could figure out the rule themselves? In any event I'm usually prone to sharing, so by default would probably have selected share without thinking too much about it.''
\end{quote}


\subsubsection{Participant 54;ea082329}
Conducted a lot of trials.  Started with a bad hypothesis (3,6,9;DNF) and shared it then ocnontinued with H- triples.  Ended up completely unable to get affirmation except for erros, which were difficult to identify.  Ended up sharing most trials.  Ended up just sharing eveyrthing at the end.

\subsubsection{Participant 55;szcluvrk}
Shelly Zhao: A2WP0DRQ2QU7MH

Shared everything.  Started with (8,10,12;FIT) but thought it was erorr, then (3,5,7;DNF) shared, then perceived one more error at the boundary (1000,10002,10004;DNF).  Also shared everything at the end.

\begin{quote}
``Sure. I believe the numbers I got were 2, 4, 6, 8 or the similar pattern. I started by wondering if it was even numbers in sequence (Trial 1 and 2). I tried odd numbers to see if it was limited to even numbers or just a difference of 2, which also seemed to work. I tried large numbers to make sure it was a +2 pattern, or if it might be a x2 for the second number and +2 for future numbers. (since 2+2=4 and 2x2=4 as well)''
``I believe I decided to share all of them because I didn't have a preference to share/withhold information. I thought if I could assist someone else to find the pattern, that would be great!'' 
``I mean I did not have a strong preference to withhold information, so I decided to go ahead and share the results I had. I did not feel particularly strongly about sharing or withholding the information, so thought if I could help others with my results, I may as well share them.''

\end{quote}

\subsubsection{Participant 56;3796js}
Joel Sprague
Usual beginning (6,8,10;FIT;Share).  Eventually got (27,29,31;DNF) no share and (41,43,45;FIT) no share, error.  Shared everythign at the end.

\begin{quote}
``I seem to remember something about the task saying that the more trials you use, the worse your score?  It was either that, or I was trying to minimize the amount of trials just to keep from confusing who I shared it with.  I honestly don't remember which it was in particular, but it was one of those.  Honestly, there was a little bit also of just wanting to guess the rule with as few trials as possible, just out of pride.

As to the sharing, that was relatively straightforward since I only got the one false positive, as far as I could tell.  I made sure not to share the false negative, as I didn't want to confuse whomever I shared trials with.  Everything that looked right, I shared, and marked as correct, just so I could give the other person the best information possible.  Of course, that was dependent upon them trusting that I knew the task and was giving them the best results.''
\end{quote}

\subsubsection{Participant 57;A1E8QOIXZ0AS2Y}
Started normally (8,10,12;FIT) but then got (4,6,8;DNF) correctly identified as error, then (10002,10004,10004;DNF) seen as error and not shared.  Very strange.  Then a few other strange trials.  Proposed that the triples are increasing by two.  Definitely scammed.

\subsubsection{Participant 58;Max2012}
Usual start with one falsifier at the end not shared (4,8,12;DNF).  Didn't finish the task.

\subsubsection{Participant 59;xxx}
Preview response.

\subsubsection{Participant 60;113240}
Abdul Aseez; A2SNIL2ZLU5A3W

All H+ trials with one error right away (6,8,10;DNF).  All shared.  May have been sneaky stopper.  Shared everything at the end

\subsubsection{Participant 61;87128VEPS}
Shared all except one trial (8,10,12;FIT).  Shared all again at the end except for one (7,9,11;FIT) and correctly attributed to error.

\subsubsection{Participant 62;33396}
All falsifications, all shared, none attributed to error. No H+ trials wer eproposed, ecxcept for first trial (12,14,16;FIT).

\subsubsection{Participant 63;730113}
Neji Earth: A2SNIL2ZLU5A3W

Shared all.  Started weird (6,2,8;DNF) shared it. Then got (3,6,9;FIT).  Then (3,6,9;DNF) and thought it was eror.  Then (8,10,12;FIT) and thought it was error.  Shared everything at the end and incorrectly identified one error.

\subsubsection{Participant 64;A3IQ4T5TA613X}
started with (12,14,16;FIT), moved to (6,12,18;DNF).  Came on he boundary (102,104,106;DNF) and though ti was an error and didn't share. Had quite a strange sharing pattern.  Very strange hypotehsis $a<100, 10a+2,10a+4,10a+6$.  Omitted several actual errors.

\subsubsection{Participant 65;sunitha01}
Possibly sneaky (4,6,8;FIT).  Shared all.  No final judgments.

\subsubsection{Participant 66;97200319}
Shared all from the beginning.  Mostly H+ trials with a few errors, most of them missed though.  Shared all at the end.

\subsubsection{Participant 67;missklp17}
All H+ trials, shared all.  One incorrect error attribution ant the beginning (10,12,14;FIT).  No error attributions at the end.

\subsubsection{Participant 68;cbartok20}
Started with trouble (4,8,12;DNF) and (1,4,10;DNF) not shared.  Got back on track with (4,6,8;FIT).  Hit the boundary with (102,104,106;DNF) shared but (102,106;110;DNF) not shared.  A couple more trials not shared.  This person scammed by omitting (102,104,106;DNF) at the end which didn't fit their hypothesis (ascending by 2) and was incorrectly attributed toe rorr, same thing with (5,7,9;DNF) was omitted and attributed to error.

\subsubsection{Participant 69;A2NY4882G4701C}
 	
Shared all.  All confirming except two crossed the boundary (102,104,106; DNF) attributed to error and (202,204,206;FIT) shared.  Same pattern at the end with the same incorrect attribution.

\subsubsection{Participant 70;051188}
Shared all trials.  A few H- trials with DNF feedback, but no errors and none identified.  All shared at the end.

\subsubsection{Participant 71;kim65}
Shared all except one correct error attribution (88,90,92;DNF) and missed one error (102,104,106;FIT).  Same at the end. 

\subsubsection{Participant 72;daisy14}
Tiffany Kilby: A351P2O6QGTCS

This person generally ommitted trials attributed to error, which were frequently right.  A few mistakes were (1,3,5;DNF) attributed to error, but then it seemed like the person realized odds don't fit the rule.  Final answer was even numbers.  This person omitted disconfirming trials that fit the rule (1,3,5;DNF).  Doesn't seem like scamming, but not sure why they would omit.

\begin{quote}
``I started off thinking about what I thought the rule could be based on the 3 numbers given at the beginning. Then I tried the different numbers to see if my theory was correct. When I put in numbers that justified what I thought the rule was it made me think that I was correct. But when I put in numbers that did not fit the rule that I was thinking of I tried to think of any other rule that would fit. When I couldn't think of any other rule I remembered that it said that it could give incorrect results for some of them and I figured that those ones must have been incorrect. So when I was completely certain of what I thought the rule was I stopped the trials and decided to make my guess.''
``I was pretty confident on what I thought the rule was so any trial that went against what I thought the rule was I didn't want to share because I did not want to confuse them.''

\end{quote}

\subsubsection{Participant 73;0765}
dfost1965@aol.com: A351P2O6QGTCS

Shared all trials. Started with a weird one (0,1,8;DNF) then (3,6,9;FIT) but seen as error.  Then an error (8,10,12;DNF) not identified.  Shared everything at the end also, making no error attributions, although there was one.  Some very H- triples. Final answer was nonsense.

\subsubsection{Participant 74;jaa246}
Shared all from the beginning.  All H+ trials.  A few errors which were not identified, and two descending trials (24,16,10;DNF) and (8,4,6;DNF).  Omitted the one corect erro attribution at the end.

\subsubsection{Participant 75;0912781413}
Started with (12,24,36;FIT), so probably got confused. Proposed (12,24,36;DNF) twice, attributing it to error the first time but not the second, sharing neither trial.  Consecutive multiples of two.

\subsubsection{Participant 76;howdy}
Proposed just a few trials (8,10,12;FIT), with one (8,10,12;DNF) attributed to errro correctly, and (6,4,2;DNF).  All shared.

\subsubsection{Participant 77;I returned the hit on accident}
Complicated.  Started with H- error (3,6,9;FIT) attributed to error but shared.  Ended up only sharing (2,4,6) trials. Weird final answer ``Enter 2,4,6 and then switch off entering 0 then 100 percent''.

\subsubsection{Participant 78;Js8021980}
Jennifer Smith: A1LKMVVMEOH1ZG 

Complicated again. Started with (5,7,9;DNF) saw it as error but shared it, then (1,3,4;DNF) shared, (4,6,8;DNF) shared but seen as error correctly.  Then on to more traditional triples.  Then shared all triples at the end of the task.

\subsubsection{Participant 79;917648531564}
All H+, all affirming, all shared.

\subsubsection{Participant 80;246}
Pretty normal set.  Began with (4,6,8;FIT).  Did not share (12,16,20;DNF) but not attributed to error.  Shared all at the end, attributed none to error, which was correct. 

\subsubsection{Participant 81;cal123}
All H+ trials except for at the boundary at the end.  Didn't share one trial (14,18,22;DNF) at the end, incorrectly attributing it to error, but this wasn't inconsistent with the final answer.  Seems like went with ascending evens. 

\subsubsection{Participant 82;la120390}
Started with (1,3,5;DNF) attribued to error and not shared, then (8,10,12;FIT) then (8,10,12;DNF) then (1,3,5;DNF) not shared.  Only shared one trial at the end (8,10,12;FIT).  Although omitted most trials, none were inconsistent with the final answer, except a correctly identified error. 

\subsubsection{Participant 83;aassaai}
No trials.

\subsubsection{Participant 84;walterross}
All shared.  Only one H- trial at the end (10,11,12;DNF).  All shared at the end.

\subsubsection{Participant 85;1029381}
Started as usual (10,12,14;FIT).  Hit an actual error (4,6,8;DNF). Did one H tests in a rwo seeing both as error (11,13,15;DNF) and sharing neither.  Hit the boundary (100,103,105;DNF) and did not share and hit it again (100,102,104;DNF) again not sharing it.  Final answer was add two to previous number, but (11,13,15;DNF) was omitted, scamming.

\subsubsection{Participant 86;SUBAN2845}
Very short. Two trials of (2,4,6;FIT) and sharing then done.  Same at end of task.

\subsubsection{Participant 87; 9221}
All (2,4,6;FIT) trials.  All shared.  End of task omitted (8,10,11;DNF).

\subsubsection{Participant 88; 1bb650f402...}
Shared everything right from the start.  Had trouble identifying the upper bound.

\subsubsection{Participant 89; ramsey}
H+ triples, no false feedback.  Didn't compelte end of task.

\subsubsection{Participant 90; 12456}
All shared from the begining.  Only (2,4,6) proposed.  Even numbers.

\subsubsection{Participant 91; 905671}
All affirming triples except (98,100,102;DNF).  All shared.

\subsubsection{Participant 92; peteydog1}
All H+ trials, all affirming, all shared.

\subsubsection{Participant 93; scoobydoobydoo}
Affirming then came on some triples that didn't want to share.  Didn't share two tials at the end (8,12,20;DNF) and (10,20,190;DNF).  The final answer was add2.  Neither of the omitted trials was inconsistent.

\subsubsection{Participant 94; 1111}
All H+, all affirming all shared except (20,22,24:DNF) but it was shared.  All shared at the end.

\subsubsection{Participant 95; 1121}
Some disconfirming trials not shared.  Did not complete the final attributions.  None of the omitted trials were inconsistent with the final answer.

\subsubsection{Participant 96; wehaddababyitsaboy}
All shared, but a variety of H- trials done.  Three omitted at the end.  One was an error (8,10,12;DNF).  What was an error (-50,-48,-46;FIT) and one was not an error (1000,1002,1004;DNF).  This last one was inconsistent with the final answer $2n where n>2$, making this a scamming.

\subsubsection{Participant 97; 56537}
A variety of trials, omitting lots of them.  Omissions at the end fo the task.  Final answer was multiples of 2 (Evens).  Omissions at the end of the task were not inconsistent with the final answer.

\subsubsection{Participant 98; Daisy43517}
Sandra Elliot: AY0BJCGY2DHIX 

All shared, with a mixture of H+ and a few H- trials at the beginning.  Did not complete final answer.

\subsubsection{Participant 99; allie23}
All H+ trials not sharing a few errors correctly identified.

\subsubsection{Participant 100; 159645}
Viji Lakshmi: A2U01ZSNRCSV3V

All H+ trials, mostly (2,4,6). All shared except one error.



First, participants may have not comprehended the perverse incentive.  However, open-ended comprehension checks before the task began indicated that participants fully grasped the perverse incentive.  For example, when asked how they and the participant they are sharing trials with earn money, a typical response was:
\begin{quote}
``\Sexpr{perverse.open1[58]}''
``\Sexpr{perverse.open2[58]}''
\end{quote}

Many participants also discontinued their participation prematurely, explaining that the rule was too simple, not realizing that they had not identified it.  For example:

  \begin{quote}
``\Sexpr{was3.t$V1086[81]}''%$
\end{quote}

  Those who quit prematurely, proposing only a few trials, also proposed only trials that they expected to receive affirmation, and received only affirmation, except for rare errors that they were highly accurate in identifying.  This confound limited participants' chance of obtaining disconfirming feedback.  As disconfirming feedback is necessary for selective reporting, this confound causes the experiments to underestimate its magnitude.  
